Talk:Citoid/API
Add topic| This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Free text query behavior
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi all! The API documentation currently says that "At present, there is guaranteed to be only one citation Object in the [response] Array". It also says that the query parameter "currently takes URLs, DOIs, PMCIDs, and PMIDs" (although I see the automatic citation wizard in the English Wikipedia's Visual Editor says "title" and "citation" too).
However, if I enter one or more words, such as "wikipedia", as query parameter, the API returns two citation objects in the response array: https://en.wikipedia.org/api/rest_v1/data/citation/mediawiki/wikipedia. They seem to be the result of some free search, as both have the word "wikipedia" somewhere in the object. Is this the expected behavior? Is this documented somewhere?
Similarly, if one of the words is a URL (for example "wikipedia http://nla.gov.au/nla.news-article19573778"), two citation objects are returned again: https://en.wikipedia.org/api/rest_v1/data/citation/mediawiki/wikipedia%20http%3A%2F%2Fnla.gov.au%2Fnla.news-article19573778. The first one seems to be the result of a free search (notice it has the word "nla"), whereas the second one is the translation result for the URL.
Thank you! Diegodlh (talk) 13:53, 11 November 2021 (UTC)
- I got the impression that you misunderstood something.
- You cannot enter a “word” or even worse “words”.
- You need to provide a URL of the precise resource you want to refer to.
- Or you may use things like “PMID 1234” or “DOI 10.1000/182”. PerfektesChaos (talk) 23:09, 11 November 2021 (UTC)
- I've now fixed the documentation, thanks for pointing that out!
- We did add free text search a little while ago (https://phabricator.wikimedia.org/T198567) but forgot to update that part of the docs. At most 2 results, one from crossref simple text query and one from WorldCat OpenSearch. It works best for fully formatted citations because we don't return enough results for a more general search. Mvolz (WMF) (talk) 10:20, 12 November 2021 (UTC)
Confusing information about the supported search queries
[edit]"search currently takes URLs, DOIs, PMCIDs, and PMID, ISBNs, QIDs, and fully formatted citations / free text search. If the unique identifier is unresolvable, you will get back a 404 response and a JSON error message."
From the Wikipedia REST API documentation: "Generates citation data given a URL, DOI, PMID, or PMCID."
And from the Citoid MediaWiki entrie: "To request metadata about a URL, DOI, PMCID, PMID or QID..."
Each one varies from the other. It's confusing. I've been triying to make petitions with ISBNs as query to verify, but I've got 404 responses.
Same with "free text search": @Mvolz (WMF) already clarified that in the current discussion page. Ivanmarribas (talk) 16:42, 8 September 2024 (UTC)
- Are you using our api or the local installation using Zotero? Historically in production we had WorldCat integration, which meant we had free text search for books, and fairly comprehensive ISBN coverage. That ended somewhat abruptly, but a few weeks later we implemented ISBN retrieval with library of congress and a few other libraries. This is why there's somewhat inconsistent documentation. Currently we have partial ISBN coverage, and free text search for journal papers and academic books, but not most popular books. Hope that helps. We're using Zotero for isbn search, so if there are some isbns that aren't getting metadata, that might mean we need additional translators added for the library repositories that hold that metadata. Mvolz (WMF) (talk) 11:30, 9 September 2024 (UTC)