Art API is a free and lightweight RESTful Web API that provides structured information about 50 of the most influential artists in history, along with selected public domain artworks.
Developers can access detailed artist bios, artwork data, and run keyword-based search queries. Whether you’re building educational apps, creative galleries, or simply experimenting, this API is a reliable resource.
You can get started by generating a free public API key. No sign-in or credit card required.
- Tech Stack
- Infrastructure Overview
- API Information
- TypeScript Types
- Usage
- RESTful Endpoints
- Projects Using Art API
- Plans for v2
- Author
- License
The current API version (v1) is built with:
- Node.js / Express.js
- TypeScript
- PostgreSQL (hosted on neon)
- Drizzle ORM
- Zod (for validation)
- Bcrypt (for secure key generation and auth)
The API is hosted on Google Cloud Platform, using:
- Cloud Run for serverless container deployment
- Application Load Balancer
- Cloud Storage to serve images
- Cloud CDN with signed storage URLs for image delivery
- Version: v1
- Base URL:
https://art.cidominguez.com/api/v1/
- Authentication: Requires a free API key. Include it in the request header as 'x-api-key'.
- Rate Limiting:
- 200 requests per 15 minutes
- After 75 requests, a delay of up to 3 seconds per request is applied
- Image Licensing: All images served are from the public domain.
- Search: Currently supports keyword-based filtering. Full-text search is planned for v2.
- If you use this API in a public or production setting, please consider linking to this repo for credit.
We welcome contributions in the form of data collection (public domain only) or code improvements.
These types describe the shape of API responses and entities:
type Artist = {
id: number;
name: string;
genre: string;
nationality: string;
bio: string;
wikipedia: string; // Extended biography URL
birthYear: string;
deathYear: string;
};
type Artwork = {
id: number;
title: string;
medium: string;
inferredYear: string;
fullImageUrl: string;
thumbnailImageUrl: string;
artistId: number;
};
export type SearchResult = {
artists: Artist[];
artworks: Artwork[];
};
export type ApiResponse<T> = {
status: number;
message: string;
data: T | null;
};
Before making requests, generate your free API key.
Note: All code snippets assume you're using Vite with TypeScript, which exposes
.env
variables viaimport.meta.env
and uses theVITE_
prefix. If you're using a different setup (e.g. Next.js, plain HTML/JS, SpringBoot) adapt accordingly as build tools differ in how they expose and manage environment variables.
Create a .env
file in your root directory and add:
VITE_ART_API_BASE_URL=https://art.cidominguez.com/api/v1
VITE_ART_API_PUBLISHABLE_KEY=<YOUR_API_KEY_HERE>
In your code, load these values via import.meta.env
(in Vite), or however your framework provides env variables.
All requests must include your API key in the headers of the request as x-api-key
:
const response = await fetch(
`${import.meta.env.VITE_ART_API_BASE_URL}/artists?nationality=French`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'x-api-key': import.meta.env.VITE_ART_API_PUBLISHABLE_KEY,
},
}
);
const data: ApiResponse<Artist[]> = await response.json();
console.log(data);
const response = await fetch(
`${import.meta.env.VITE_ART_API_BASE_URL}/artworks?title=lilies`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'x-api-key': import.meta.env.VITE_ART_API_PUBLISHABLE_KEY,
},
}
);
const data: ApiResponse<Artwork[]> = await response.json();
console.log(data);
name
– Partial match (e.g.,name=van
)genre
– Exact matchnationality
– Exact matchbirthYearMin
,birthYearMax
– Filter by birth yeardeathYearMin
,deathYearMax
– Filter by death year
-
GET /artists
Returns all artists ordered byid
ascending. -
GET /artists/:id
Returns a single artist byid
. -
GET /artists/random
Returns a random artist. -
GET /artists/:id/full
Returns an artist and all their artworks.
title
– Partial title matchmedium
– Exact matchartistId
– Filter by artist ID
-
GET /artworks
Returns all artworks ordered byid
. -
GET /artworks/:id
Returns a single artwork byid
. -
GET /artworks/random
Returns a random artwork.
Performs a global keyword-based search across both artists and artworks.
const response = await fetch(
`${import.meta.env.VITE_ART_API_BASE_URL}/search?q=monet&nationality=French`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'x-api-key': import.meta.env.VITE_ART_API_PUBLISHABLE_KEY,
},
}
);
const data: ApiResponse<SearchResult> = await response.json();
console.log(data);
Have you built something with the Art API? Open a PR to be featured here.
The next release (v2) will prioritize developer experience, performance, and support for additional open data sources.
Planned features:
-
Year Normalization Improve support for inferred or ambiguous artwork dates with partial range support (e.g.,
1870s
,early 1800s
). -
Flexible Image Service New
fullImageUrl
andthumbnailImageUrl
generation service with support forwidth
,height
, andfileType
(e.g., WebP, JPEG). -
More Open Sources Additional data sources will be integrated, with proper attribution listed in the documentation.
Maintained by @cdom27. Feel free to open issues or suggest improvements.
This project and API are licensed under the MIT License. All artwork images are sourced from the public domain.