# Query Wikidata — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Get comprehensive biographical information about any person, including key facts like birth dates, nationality, and professions, plus detailed life events organized by topic and time period. Search for people and retrieve structured biographical data all in one place.

**Category:** Government & Public Data | **Website:** [query.wikidata.org/](https://query.wikidata.org/) | **Docs:** [parse.bot/marketplace/b8bf99d5-01a6-4055-b90f-522ae1698078/query-wikidata-org-api](https://parse.bot/marketplace/b8bf99d5-01a6-4055-b90f-522ae1698078/query-wikidata-org-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-query-wikidata-org-api-b8bf99d5/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### extract_biography

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.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `urls` | string | Yes | 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') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-query-wikidata-org-api-b8bf99d5/extract_biography \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls":"<string>"}'
```

### get_person_details

Get detailed biographical data for a person by their Wikidata entity ID (QID). Returns structured biographical facts from Wikidata combined with rich narrative content from Wikipedia. The QID must be in the format Q followed by digits (e.g. Q937 for Albert Einstein).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `qid` | string | Yes | The Wikidata entity ID (e.g. 'Q7186' for Marie Curie, 'Q937' for Albert Einstein) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-query-wikidata-org-api-b8bf99d5/get_person_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"qid":"<string>"}'
```

### search_person

Search for a person by name and return their full biographical data including structured facts and notable life events. Uses Wikidata entity search to find the person, then combines Wikidata structured data with Wikipedia narrative content. Returns stale_input if no matching person is found.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | The person's name to search for (e.g. 'Marie Curie', 'Albert Einstein') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-query-wikidata-org-api-b8bf99d5/search_person \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>"}'
```
