# Nationalgallery — 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.

> Access data from nationalgallery.org.uk.

**Category:** Entertainment | **Website:** [www.nationalgallery.org.uk/paintings/explore-the-collection](https://www.nationalgallery.org.uk/paintings/explore-the-collection) | **Docs:** [parse.bot/marketplace/b7466f2a-d224-4526-b643-b2a8c997e2e4/nationalgallery-org-uk-api](https://parse.bot/marketplace/b7466f2a-d224-4526-b643-b2a8c997e2e4/nationalgallery-org-uk-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-nationalgallery-org-uk-api-b7466f2a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_painting

Get detailed information about a single painting by its URL slug. Returns metadata including title, artist, dates, medium, dimensions, location, and a description.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | URL slug of the painting (e.g. 'claude-monet-still-life'). Obtainable from search_paintings results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalgallery-org-uk-api-b7466f2a/get_painting \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### search_paintings

Search the National Gallery collection by keyword. Results include title, artist, date, location, and a brief overview. The upstream API has no stateless pagination mechanism (it requires tracking viewed item IDs); use the limit parameter to control how many results are returned in a single request (up to ~100).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of paintings to return per request (up to ~100). |
| `query` | string | No | Keyword to search for (e.g. artist name, subject, title). Empty string returns all paintings. |
| `sort` | string | No | Sort order for results. |
| `time_period_from` | string | No | Filter paintings made from this year onward. Accepted values: 100, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1750, 1800, 1850, 1900. |
| `time_period_to` | string | No | Filter paintings made up to this year. Accepted values: 299, 1299, 1349, 1399, 1449, 1499, 1549, 1599, 1649, 1699, 1749, 1799, 1849, 1899, 1949. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalgallery-org-uk-api-b7466f2a/search_paintings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","query":"<string>","sort":"<string>","time_period_from":"<string>","time_period_to":"<string>"}'
```
