Page MenuHomePhabricator

Add Citoid support to RefToolbar gadget
Closed, ResolvedPublic3 Estimated Story Points


Since T94223 is probably going to be declined, we should consider more short-term solutions. (The long-term solution is theoretically T104479).

It should be relatively easy to add Citoid support to the RefToolbar gadget. It already supports look-ups for other parameters like DOI and PMID. We should just switch it to use the Citoid public API and add a URL lookup as well.

The code for the RefToolbar lookup API resides at

Event Timeline

kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added a project: Community-Tech.
kaldari added a subscriber: kaldari.
kaldari set Security to None.

It looks like the output of the Citoid API varies considerably depending on what type of URL is used. For example, if the URL is for a book chapter ( it will return the chapter title as "title" and the book title as "bookTitle", but if the URL is for a book (, it will return the book title as "title". So we'll need to be careful to look at the itemType before deciding how to map the values.

FWIW, it seems that Mr.Z-Man (Alex) has possibly retired from Wikipedia. He hasn't edited any projects or touched any of his tools in GitHub for the past couple months. If someone wanted to work on this, they might have to folk the code.

kaldari claimed this task.

Went ahead and did this over the weekend.

DannyH edited a custom field.
DannyH edited a custom field.
DannyH added a project: Community-Tech-fixes.

In the editor, I lookup a DOI and get no result (10.1109/ase.2011.6100176)

In the console, I see that the AJAX Call is made to reftoolbar, and it returns nothing:

On the contrary, a call to the citation API would return the correct result:

How to use the right URL is the editor gadget?

I believe you have to use the "URL" field for citoid results in reftoolbar.
I'm not sure who is running the reftoolbar labs instance but maybe it's
broken. Putting the doi in the URL field should work for the time being.

Probably there should be a separate bug filed for the doi field issue.

Thanks for your answer. We make progress.

There is a difference depending on the editor:

Yet, it does not work in the Visual Editor, because of an encoding problem, see T207518

RefToolbar queries Citoid only for ISBN and URL queries, see

This pull-request proposes that RefToolbar also uses Citoid for DOI calls:

Yes, you have to put the DOI in the URL field if you want a response from
citoid - a bit confusing. Plausibly we should enable citoid for the DOI
field as well.