How to hit the Wikidata API

Wikidata stores structured facts: every item has an id (Q42 is Douglas Adams) and statements keyed by property ids (P31 is instance of).

Authentication

None for reading. Wikimedia asks automated clients to send a descriptive User-Agent.

Full reference: https://www.wikidata.org/wiki/Wikidata:REST_API

Get an item's labels

curl "https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q42&props=labels|descriptions&languages=en&format=json&origin=*"
Run in PostTaco
Example response (trimmed)
{
  "entities": {
    "Q42": {
      "type": "item",
      "id": "Q42",
      "labels": {
        "en": {
          "language": "en",
          "value": "Douglas Adams"
        }
      },
      "descriptions": {
        "en": {
          "language": "en",
          "value": "British science fiction writer and humorist (1952–2001)"
        }
      }
    }
  },
  "success": 1
}