# Extract Data on World Leaders from Wikidata

**Use case:** 

Retrieve detailed information about world leaders, including names, countries, and terms in office from Wikidata. Access structured entity data seamlessly.

## Input

```json
{
  "mode": "sparql",
  "query": "Douglas Adams",
  "qids": [
    "Q42",
    "Q64",
    "Q1"
  ],
  "sparql": "SELECT ?person ?personLabel ?country ?countryLabel ?start ?end WHERE { ?person wdt:P31 wd:Q5 . ?person p:P39 ?stmt . ?stmt ps:P39 wd:Q30461 . OPTIONAL { ?stmt pq:P580 ?start . } OPTIONAL { ?stmt pq:P582 ?end . } ?person wdt:P27 ?country . SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\". } } LIMIT 300",
  "language": "en",
  "maxResults": 300,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

## Output

```json
{
  "qid": {
    "label": "QID",
    "format": "text"
  },
  "label": {
    "label": "Label",
    "format": "text"
  },
  "description": {
    "label": "Description",
    "format": "text"
  },
  "instanceOf": {
    "label": "Instance Of",
    "format": "text"
  },
  "aliases": {
    "label": "Aliases",
    "format": "text"
  },
  "wikidataUrl": {
    "label": "Wikidata URL",
    "format": "link"
  },
  "claims": {
    "label": "Claims (JSON)",
    "format": "text"
  },
  "sparqlBindings": {
    "label": "SPARQL Bindings",
    "format": "text"
  },
  "mode": {
    "label": "Mode",
    "format": "text"
  }
}
```

## About this Actor

This example demonstrates how to use [Wikidata Scraper — Search, Entities & SPARQL API](https://apify.com/logiover/wikidata-scraper) with a specific input configuration. Visit the [Actor detail page](https://apify.com/logiover/wikidata-scraper) to learn more, explore other use cases, and run it yourself.