Org APInationalgallery.org.uk ↗
Search and retrieve painting metadata from the National Gallery collection. Get titles, artists, dates, dimensions, and descriptions via 2 endpoints.
What is the Org API?
The National Gallery API gives developers access to painting data from nationalgallery.org.uk across 2 endpoints. Use search_paintings to query the collection by keyword, artist name, or time period and retrieve summaries including title, artist, date, and gallery location. Use get_painting to pull full metadata on a single work — dimensions, medium, collection, and a prose description from the gallery's 'About the work' section.
curl -X POST 'https://api.parse.bot/scraper/30fbdb89-ccea-4717-84f5-36882c111d58/search_paintings' \
-H 'X-API-Key: $PARSE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"sort": "Random",
"limit": "10",
"query": "Monet"
}'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 nationalgallery-org-uk-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: National Gallery SDK — bounded, re-runnable; every call capped."""
from parse_apis.nationalgallery_org_uk_api import NationalGallery, Sort, PaintingNotFound
client = NationalGallery()
# Search for Monet paintings sorted alphabetically by artist
for painting in client.paintings.search(query="Monet", sort=Sort.ARTIST_ASC, limit=3):
print(painting.title, painting.artist, painting.date_made)
# Drill-down: take ONE item and get full details
item = client.paintings.search(query="sunflowers", sort=Sort.RELEVANCE, limit=1).first()
if item:
try:
full = client.paintings.get(slug=item.slug)
print(full.title, full.artist, full.medium_and_support, full.dimensions)
except PaintingNotFound as e:
print(f"not found: {e.slug}")
print("exercised: paintings.search, paintings.get")
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).
| Param | Type | Description |
|---|---|---|
| sort | string | Sort order for results. |
| limit | integer | Maximum number of paintings to return per request (up to ~100). |
| query | string | Keyword to search for (e.g. artist name, subject, title). Empty string returns all paintings. |
| time_period_to | string | Filter paintings made up to this year. Accepted values: 299, 1299, 1349, 1399, 1449, 1499, 1549, 1599, 1649, 1699, 1749, 1799, 1849, 1899, 1949. |
| time_period_from | string | Filter paintings made from this year onward. Accepted values: 100, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1750, 1800, 1850, 1900. |
{
"type": "object",
"fields": {
"limit": "the limit that was applied",
"total": "total number of matching paintings in the collection",
"paintings": "array of painting summaries with title, slug, artist, date_made, location, overview"
},
"sample": {
"data": {
"limit": 10,
"total": 57,
"paintings": [
{
"url": "https://www.nationalgallery.org.uk/paintings/claude-monet-still-life",
"slug": "claude-monet-still-life",
"title": "Still Life",
"artist": "Claude Monet",
"location": "Room 41",
"overview": "Loosely painted in vibrant colours against a plain brown background, Monet carefully placed a still life of fruit on a tabletop...",
"date_made": "About 1869"
}
]
},
"status": "success"
}
}About the Org API
Searching the Collection
The search_paintings endpoint accepts a query string (artist name, subject, or title keyword) and returns an array of painting summaries. Each result includes title, slug, artist, date_made, location, and overview. The response also returns total — the full count of matching works — and respects the limit parameter, which caps results at roughly 100 per request. You can narrow results by production era using time_period_from and time_period_to, which accept discrete year values (e.g. 1400, 1550, 1649). Passing an empty string as query returns all paintings in the collection.
Pagination Behavior
The collection does not support conventional offset or cursor-based pagination. There is no page or offset parameter. Because the upstream source tracks viewed items by ID rather than by page number, stateless pagination is not available. Use limit to control how many records come back in a single response, and plan your integration accordingly if you need to traverse large result sets.
Painting Detail
The get_painting endpoint takes a slug — obtainable from search_paintings results — and returns a complete record for one work. Fields include title, artist, date_made, dimensions, location within the gallery, collection, a description from the gallery's curatorial notes, and artist_url pointing to the artist's page on the National Gallery site. The url field gives the canonical page address for the painting.
The Org API is a managed, monitored endpoint for nationalgallery.org.uk — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when nationalgallery.org.uk 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 nationalgallery.org.uk 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?+
- Build a searchable index of National Gallery paintings filterable by time period and artist
- Populate an art education app with painting descriptions, dates, and dimensions from the gallery's curatorial text
- Generate artist profiles by aggregating
artist,date_made, andcollectionfields across multiple search results - Display room-level gallery locations (
locationfield) to help visitors plan which works to see in person - Cross-reference
dimensionsandmediumdata fromget_paintingfor art historical research datasets - Build a timeline visualization of the collection using
time_period_fromandtime_period_tofilter parameters - Automate discovery of recently highlighted works by querying specific keywords against the full collection
| 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.
Does the National Gallery have an official developer API?+
What does `get_painting` return beyond what `search_paintings` provides?+
search_paintings returns a brief overview per painting. get_painting returns a fuller description from the gallery's 'About the work' section, plus dimensions, medium (via the full record), collection, and artist_url. Use the slug from search results as the input to get_painting.How do the time period filters work in `search_paintings`?+
time_period_from and time_period_to parameters accept discrete year values only — for example 1400, 1450, 1500, 1550. Arbitrary year values are not supported. Use them together to bracket a date range, or use either alone to set a floor or ceiling.Does the API return images or image URLs for paintings?+
get_painting endpoint covers text metadata: title, artist, dimensions, description, location, and related URLs. You can fork this API on Parse and revise it to add image URL extraction if your use case requires artwork images.Can I retrieve artist biography pages or see all works by a specific artist in one call?+
query parameter in search_paintings, which returns all matching results up to your limit. Full artist biography data is not currently covered. You can fork this API on Parse and revise it to add an artist detail endpoint using the artist_url field returned by get_painting.