# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/query-wikidata/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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/credits/query-wikidata/extract-biography \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/query-wikidata/get-person-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/query-wikidata/search-person \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.