Wikidata APIquery.wikidata.org ↗
Extract structured biographical data from Wikipedia and Wikidata. Get names, birth/death dates, nationalities, professions, and narrative life events via 3 endpoints.
What is the Wikidata API?
The Wikidata & Wikipedia Biography API exposes 3 endpoints for retrieving structured biographical data on any notable person. Use search_person to look up someone by name, get_person_details to fetch by Wikidata QID, or extract_biography to pull data from one or more Wikipedia or Wikidata URLs in a single call. Each response combines structured facts — birth and death dates, nationality, profession — with narrative life events grouped by topic.
curl -X GET 'https://api.parse.bot/scraper/32c5108a-abe3-41c2-b7de-4534b2aa0cc6/extract_biography?urls=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMarie_Curie' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace query-wikidata-org-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: WikiBio SDK — search, fetch by QID, and batch-extract biographies."""
from parse_apis.wikipedia.wikidata_biography_extraction_api import WikiBio, PersonNotFound
client = WikiBio()
# Search for a person by name — returns a typed Biography with structured fields.
bio = client.biographies.search(name="Marie Curie")
print(f"Found: {bio.name}, born {bio.birth_date}, died {bio.death_date}")
print(f"Nationality: {bio.nationality}")
print(f"Profession: {bio.profession}")
print(f"Summary (first 120 chars): {bio.summary[:120]}")
# Walk notable life events from the biography.
for event in bio.notable_events[:3]:
print(f" [{event.topic}] {event.text[:80]}...")
# Fetch by Wikidata QID — direct lookup when you already know the entity ID.
einstein = client.biographies.get(qid="Q937")
print(f"\nEinstein: {einstein.name}, {einstein.birth_date} – {einstein.death_date}")
print(f"Professions: {einstein.profession}")
# Batch extract from Wikipedia URLs — returns a paginator of Biography objects.
for extracted in client.biographies.extract(
urls="https://en.wikipedia.org/wiki/Nikola_Tesla,https://en.wikipedia.org/wiki/Isaac_Newton",
limit=2,
):
print(f"\nExtracted: {extracted.name}, born {extracted.birth_date}")
print(f" Events: {len(extracted.notable_events)} topics")
# Typed error handling: catch PersonNotFound when searching for a nonexistent name.
try:
client.biographies.search(name="Zzzyxqwert Nonexistent Person 12345")
except PersonNotFound as exc:
print(f"\nPerson not found: {exc.name}")
print("\nExercised: biographies.search / biographies.get / biographies.extract / PersonNotFound")
Extract biographical data from one or more Wikipedia or Wikidata URLs. Returns a JSON object with an items array containing one biography object per URL. Supports Wikipedia article URLs (en.wikipedia.org/wiki/...) and Wikidata entity URLs (wikidata.org/wiki/Q...). Returns empty object {} for inaccessible or non-biographical URLs.
| Param | Type | Description |
|---|---|---|
| urlsrequired | string | Comma-separated list of Wikipedia or Wikidata URLs to extract biographical data from (e.g. 'https://en.wikipedia.org/wiki/Marie_Curie,https://www.wikidata.org/wiki/Q937') |
{
"type": "object",
"fields": {
"items": "array of biography objects, each containing: name (string or null), birth_date (string YYYY-MM-DD or null), death_date (string YYYY-MM-DD or null), nationality (string or null), profession (string or null), summary (string), notable_events (array of {topic: string, text: string})"
},
"sample": {
"data": {
"items": [
{
"name": "Marie Sklodowska-Curie",
"summary": "Maria Salomea Sklodowska Curie was a Polish and naturalised-French physicist and chemist.",
"birth_date": "1867-11-07",
"death_date": "1934-07-04",
"profession": "physicist, chemist, university teacher",
"nationality": "Second Polish Republic, France, Russian Empire",
"notable_events": [
{
"text": "Maria Salomea Sklodowska was born on 7 November 1867 in Warsaw.",
"topic": "Early years"
}
]
}
]
},
"status": "success"
}
}About the Wikidata API
What the API Returns
Every biography response includes a name, ISO-formatted birth_date and death_date (both nullable), profession as a comma-separated string of roles, nationality as a comma-separated string of countries, a summary paragraph, and a notable_events array. Each element in notable_events has a topic label (e.g., "Early life", "Scientific work") and a text block drawn from the corresponding Wikipedia article section.
Endpoints
search_person takes a name string — "Marie Curie", "Albert Einstein" — and returns the full biography object for the best-matching Wikidata entity. get_person_details accepts a Wikidata QID directly (e.g., Q937 for Einstein) and is useful when you already know the canonical entity identifier and want deterministic results. extract_biography accepts a comma-separated urls parameter with any mix of Wikipedia article URLs and Wikidata entity URLs, returning an array of biography objects in the same order; non-biographical or inaccessible URLs return an empty object {}.
Data Shape and Coverage
Dates are returned in YYYY-MM-DD format where available, and fields are null when the source lacks the value — the response shape is consistent regardless of how complete the underlying data is. The notable_events array length varies by subject; well-documented figures may return a dozen or more topic sections, while less-covered individuals may return only a few. The API covers only persons; querying organizational or geographic Wikidata entities via extract_biography will return an empty object.
Disambiguation and QID Lookup
When multiple Wikidata entities share a name, search_person resolves to the top-ranked entity match. If you need a specific person who shares a common name with others, use get_person_details with the exact QID to bypass ambiguity. You can find QIDs by searching directly on wikidata.org and reading the entity identifier from the URL.
The Wikidata API is a managed, monitored endpoint for query.wikidata.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when query.wikidata.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official query.wikidata.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Populating author profile pages with birth dates, nationalities, and professions from
search_person - Building a knowledge graph of historical figures using
get_person_detailswith known QIDs - Batch-enriching a list of Wikipedia URLs with structured biographical facts via
extract_biography - Generating timeline visualizations from the
notable_eventsarray grouped by topic - Validating or de-duplicating a people database by cross-referencing Wikidata QIDs
- Surfacing structured bios in a research tool where users search by name and expect key facts at a glance
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Do Wikidata and Wikipedia offer an official developer API?+
What does `extract_biography` return when given a mix of valid and invalid URLs?+
{}. The array length always matches the number of URLs submitted.How detailed is the `notable_events` data?+
notable_events array reflects the section structure of the corresponding Wikipedia article. Each entry has a topic string (the section heading) and a text block. Breadth and depth vary by subject — major historical figures with extensive Wikipedia coverage produce many entries, while individuals with short articles may produce only one or two. There is no filtering parameter to request specific topics; all available sections are returned.Does the API return images, external links, or Wikipedia categories for a person?+
Can I retrieve biographical data in languages other than English?+
summary and notable_events fields, and English Wikidata labels for name, profession, and nationality. Non-English Wikipedia articles are not supported at this time. You can fork this API on Parse and revise it to target a different Wikipedia language edition.