DBpedia

Data API · Works globally · RDF/Linked Data · Wikipedia extraction

TL;DR

DBpedia is a crowd-sourced project that extracts structured, machine-readable data from Wikipedia infoboxes and categories. Every Wikipedia article becomes a DBpedia resource with typed properties and links to other resources. Data is available as RDF (JSON-LD, Turtle, N-Triples) and through a SPARQL endpoint. It is a cornerstone of the Linked Open Data cloud, connecting billions of facts across the web.

Quick start: https://dbpedia.org/data/Barack_Obama.json

No API key needed — just make a request!

How to Use This API

1. Get Entity Data (JSON)

https://dbpedia.org/data/Barack_Obama.json

2. SPARQL Query Endpoint

https://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=SELECT+DISTINCT+%3FConcept+WHERE+%7B%5B%5D+a+%3FConcept%7D+LIMIT+10&format=json

3. Browser Entity Page

https://dbpedia.org/page/London

4. JavaScript — Fetch Entity

fetch('https://dbpedia.org/data/Barack_Obama.json')
  .then(r => r.json())
  .then(d => {
    const uri = 'http://dbpedia.org/resource/Barack_Obama';
    console.log(d[uri]);
  });

5. Python — SPARQL Query

import requests, json

query = """
PREFIX dbo: 
PREFIX dbp: 
SELECT ?city ?population WHERE {
  ?city a dbo:City ;
        dbp:populationTotal ?population .
  FILTER(?population > 5000000)
} LIMIT 10
"""
resp = requests.get('https://dbpedia.org/sparql', params={
    'query': query,
    'format': 'json'
})
for bind in resp.json()['results']['bindings']:
    print(bind['city']['value'], '—', bind['population']['value'])
Try it: https://dbpedia.org/data/London.json

Frequently Asked Questions

What is RDF/Linked Data?
Resource Description Framework — every fact is a triple (subject-predicate-object). DBpedia uses this to represent Wikipedia data as machine-readable graphs.
What formats are available?
.json (JSON-LD), .nt (N-Triples), .ttl (Turtle), .rdf (RDF/XML), and .n3 (Notation3). Append format extension to the data URL.
How do I query with SPARQL?
Use the SPARQL endpoint at /sparql with a SPARQL SELECT query. Results in JSON, XML, CSV, or TSV via the format parameter.
How current is DBpedia data?
DBpedia extracts are generated from Wikipedia dumps, typically updated monthly. The data may lag behind live Wikipedia edits by weeks.
Can I use DBpedia in commercial projects?
Yes, DBpedia data is licensed under CC-BY-SA, the same as Wikipedia. Attribution is required.

What You Can Build