# Country GDP Data Query from Wikidata SPARQL

**Use case:** 

Extract GDP, population, and capital data for countries from Wikidata using SPARQL queries. Get structured insights without any login required.

## Input

```json
{
  "mode": "sparql",
  "query": "Douglas Adams",
  "qids": [
    "Q42",
    "Q64",
    "Q1"
  ],
  "sparql": "SELECT ?country ?countryLabel ?gdp ?population ?capital ?capitalLabel WHERE { ?country wdt:P31 wd:Q3624078 . OPTIONAL { ?country wdt:P2131 ?gdp . } OPTIONAL { ?country wdt:P1082 ?population . } OPTIONAL { ?country wdt:P36 ?capital . } SERVICE wikibase:label { bd:serviceParam wikibase:language \"en\". } } ORDER BY DESC(?gdp) LIMIT 200",
  "language": "en",
  "maxResults": 200,
  "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.