API & Developers

Access TheNameDB data programmatically. Free for non-commercial use with attribution.

Name Lookup

Look up a given name or surname by exact match.

GET /api/lookup?name={name}
curl "https://www.thenamedb.com/api/lookup?name=James"

Returns: found, type (given_name or surname), name, slug, meaning, origin, gender, url

Search

Search across given names, surnames, and historical people.

GET /api/search?q={query}
curl "https://www.thenamedb.com/api/search?q=elizabeth"

Returns an array of search results with name, type, slug, and content.

Name Popularity

Get year-by-year birth counts for a name (SSA data, 1880-2023).

GET /api/name-popularity/{name}
curl "https://www.thenamedb.com/api/name-popularity/james"

Returns an array of {year, count} objects.

Name Generator

Get random names with optional filters.

GET /api/name-generator?gender={M|F}&origin={origin}&letter={A-Z}
curl "https://www.thenamedb.com/api/name-generator?gender=F&origin=Hebrew"

Returns an array of {name, slug, gender, origin, meaning} objects. All parameters are optional.

Family Names Analysis

Look up multiple names at once (2-6 names, comma-separated).

GET /api/family-names?names={name1},{name2},{name3}
curl "https://www.thenamedb.com/api/family-names?names=John,Mary,Smith"

Returns an array of results, each with input, found, found_as, and the full name data.

Name of the Day Widget

Get today's featured name.

GET /api/widget/notd
curl "https://www.thenamedb.com/api/widget/notd"

Returns {name, slug, meaning, origin, gender, url}.

Embeddable Widget

Add the "Name of the Day" widget to your website. Just paste this snippet:

<div id="thenamedb-notd"></div> <script src="https://www.thenamedb.com/embed.js"></script>

The widget renders a styled card with today's featured name and links back to TheNameDB.

OG Image Cards

Get shareable social media cards (1200x630 PNG) for any name.

GET /api/og/name/{slug} GET /api/og/surname/{slug}
curl "https://www.thenamedb.com/api/og/name/james" -o james.png

Attribution

When using TheNameDB data, please include a link back to thenamedb.com. Example:

Powered by <a href="https://www.thenamedb.com">TheNameDB</a>