Wikidata talk:REST API feedback round
Add topicArchives |
|---|
Simple search is now available in the REST API!
[edit]Hello everyone,
As part of our ongoing work to introduce search capabilities to the REST API, we’ve completed the initial endpoints for simple search on items and properties. These are currently available in the "v0" version — we’re looking to gather community feedback, refine the functionality, and then roll out a stable v1 release.
We would really appreciate feedback on what you like, or dislike. You can leave any thoughts directly on this page!
In addition, we're planning to add prefix search by end of July and hopefully continue tackling other relevant functionality after.
Feel free to send feedback directly to ifrah.khanyaree@wikimedia.de if you prefer not to share it here
--Ifrahkhanyaree WMDE (talk) 14:11, 11 June 2025 (UTC)
- I'm not finding a way to see the number of results, is it possibly without paging the potential 10 000 results? Maybe tricky given that one can technically have more results than the API is able to serve? Abbe98 (talk) 17:12, 16 June 2025 (UTC)
- Hi, you're right, it's not possible to see the number of results, you'd just have to ask for a number you need/upto 10k. I'd be interested to hear why you might find that a helpful feature? I can then dig more into it :) Ifrahkhanyaree WMDE (talk) 09:50, 17 June 2025 (UTC)
Feedback regarding ranking differences
[edit]@Ifrahkhanyaree_WMDE: I was thinking of switching one of my tools over to use this new API, however I'm not super happy with the results its showing.
- Kitesurf
- https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Kitesurf&language=en&format=json&origin=* shows kite surfing (Q219554) first, which is what I was looking for
- https://www.wikidata.org/w/rest.php/wikibase/v0/search/items?q=Kitesurf&language=en shows it but much further down
wbsearchentities was matching on the en alias kitesurfing, however the new endpoint is matching on pt label kitesurf, and I guess that means the rankings have changed somewhat?
I tried also with windsurf
- Windsurf
- https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Windsurf&language=en&format=json&origin=* show windsurfing (Q191051) second which is what I was looking for, only beaten by a first match
- https://www.wikidata.org/w/rest.php/wikibase/v0/search/items?q=Windsurf&language=en doesnt show Q191051 at all
- https://www.wikidata.org/w/rest.php/wikibase/v0/search/items?q=Windsurf&language=en&limit=100 expanding the limit does show it, but in 32nd position
wesearchentities was matching on en label windsurfing, however the new endpoint was again patching on a pt label windsurf
So generally, the rankings seem less useful for users of my tool right now? Not sure what has changed behind the scenes? ·addshore· talk to me! 18:45, 17 June 2025 (UTC)
- Hello hello, so there's two things here
- 1. You're using wbsearchentities which is not the equivalent to the simple search endpoints we just made available, we're currently building this out as prefix search endpoints. They'll hopefully be available in the next month
- 2. But! we did find a way to make simple search better and there's a ticket for it here which might already cover the needs of your tool
- As soon as that's available, I'd be happy to hear if it's helpful and you can move the tool over
- Cheers, Ifrahkhanyaree WMDE (talk) 10:20, 23 June 2025 (UTC)