Baby Names API

A fast, lightweight, and free REST API for baby name data.

← Back to Main Website

Overview

Welcome to the Baby Names API documentation. This API provides free access to thousands of baby names, including their meanings, origins, and gender associations. It is served directly from a JSON data source for high performance.

Attribution Requirement: This API is completely free to use. All responses include a source property. We politely request that you include an attribution link back to our site in applications or websites utilizing the data.

"source": "https://babynames.netstudy.in"

Base URL: https://babynames.netstudy.in/api/

Response Format: All responses are automatically returned in JSON format.

Available Endpoints

GET /api/random-name
GET /api/random-names
GET /api/name-of-the-day
GET /api/name/{name}
GET /api/names
GET /api/names?letter=a
GET /api/names?gender=male
GET /api/names?origin=indian
GET /api/names?numerology=8
GET /api/search?q=bas
GET /api/popular-names
GET /api/related-names/{name}

Individual Name Fetching

Retrieve single or multiple specific named entities.

GET /api/random-name

Returns a single, randomly generated baby name.

GET /api/random-names

Returns a list of 10 random baby names. You can pass a ?count={n} parameter to fetch up to 50 names at once.

GET /api/name/{name}

Search for a specific baby name and retrieve its exact details (e.g., /api/name/aarav).

GET /api/name-of-the-day

Returns a single selected name that changes daily based on the current date.


Collections & Searching

Retrieve multiple names based on specific filters or algorithms.

GET /api/names

Retrieve multiple names based on specific filters. You can combine any of the parameters below.

Parameter Description
letter Filter names starting with a specific letter (e.g., a).
gender Filter by gender. Valid values: male, female, unisex.
origin Filter by origin/religion (e.g., indian, arabic, christian).
numerology Filter by numerology integer (e.g., 8).
GET /api/search?q={query}

Fuzzy searches through the database to find names where the name or meaning contains your search query.

GET /api/popular-names

Retrieve a list of the 20 most popular baby names across the database.

GET /api/related-names/{name}

Looks up the given name and returns a list of alternative names that share the same origin and gender.


Example Response

{
  "name": "Aarav",
  "meaning": "Peaceful",
  "origin": "Hindu",
  "gender": "Boy",
  "numerology": 2,
  "source": "https://babynames.netstudy.in"
}

Integration Examples

Here are copy-paste examples to help you integrate the API into your projects.

JavaScript (Fetch)
PHP (cURL)
PHP (file_get_contents)
async function getPopularNames() {
    try {
        const response = await fetch('https://babynames.netstudy.in/api/popular-names');
        
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        
        const data = await response.json();
        
        console.log(`Found ${data.count} names.`);
        data.results.forEach(item => {
            console.log(`- ${item.name} (${item.gender}, ${item.origin})`);
        });
        
    } catch (error) {
        console.error('Error fetching data:', error);
    }
}

getPopularNames();
<?php
$ch = curl_init();

$url = "https://babynames.netstudy.in/api/name/Aarav";

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Request Error:' . curl_error($ch);
} else {
    $data = json_decode($response, true);
    
    if (isset($data['error'])) {
        echo "Error: " . $data['error'];
    } else {
        echo "Name: " . $data['name'] . "\n";
        echo "Meaning: " . $data['meaning'] . "\n";
        echo "Credits: " . $data['source'] . "\n";
    }
}

curl_close($ch);
?>
<?php
$url = "https://babynames.netstudy.in/api/names?letter=a&gender=male";

// Suppress warnings in case of 404/500
$json = @file_get_contents($url);

if ($json === false) {
    echo "Failed to retrieve data.";
} else {
    $data = json_decode($json, true);
    
    echo "Total Results: " . $data['count'] . "\n";
    
    // Always include the attribution when using the data
    echo "\nPowered by: " . $data['source'];
}
?>

"Baby Name of the Day" Widget

Do you own a website or blog? You can easily embed our free "Baby Name of the Day" widget to provide a daily dose of inspiration to your visitors!

The widget is lightweight, responsive, and automatically styled to look great on any website. Best of all, it requires absolutely no maintenance on your part.

Embed Code

Copy and paste this HTML code exactly where you want the widget to appear on your page:

<!-- Baby Name of the Day Widget -->
<div id="baby-name-widget"></div>
<script src="https://babynames.netstudy.in/widget.js"></script>

Note: The widget inherently includes a small, unobtrusive "Powered by babynames.netstudy.in" footer link, which serves as the required attribution.