Getting the Wikidata id of a Wikipedia/Wikivoyage/Wiktionary article (in a particular language) is easy to do using the Wikidata API, but takes too much time when you have thousands of ids to find.

Is there a program that could do the hard work for me, and be efficient for large volumes?

It could possibly work by downloading http://dumps.wikimedia.org/wikidatawiki/latest/wikidatawiki-latest-wb_items_per_site.sql.gz or similar and wither parse it directly or load it into a database.


  • Works for all languages/projects (for instance Italian Wikivoyage, Japanese Wiktionary, etc)
  • Open source
  • Command line
  • Answers each request in less than 100ms (except the first, which downloads data)
  • Possibility to reset the data (when I think it is outdated)
  • 1
    BTW, using the API, you can get up to 50 articles using a single request (or 500, if you have a bot account on Wikidata).
    – svick
    Oct 2 '14 at 12:18
  • 1
    @svick: I might end up doing this, as wikidatawiki-latest-wb_items_per_site.sql takes days to load into MySQL.
    – Nicolas Raoul
    Oct 3 '14 at 2:44

The solution was provided this week in a Wikidata-l thread: use Magnus' linked items or Wikidata Reconcile for OpenRefine.

Linked items: usage

Enter [[Paris]] [[Rome]] [[Sofia]], press the button, and you get Q90 Q220 Q472.

  • 1
    Linked items is great, but are you sure Wikidata Reconcile can be used for this? https://tools.wmflabs.org/wikidata-reconcile/?queries={"query"%3A"Rome"%2C"query"%3A"Paris"} does not seem to work.
    – Nicolas Raoul
    Jul 27 '15 at 2:27
  • 1
    Thanks for adding a more specific example, sorry for being unclear. As for Wikidata Reconcile, it has to be used from within OpenRefine AFAIK; didn't test yet.
    – Nemo
    Jul 27 '15 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.