U.S. Names API

An API of U.S. male and female first names.

View API Docs

API Documentation

Getting Started

U.S. Names API is a fairly simple API to use. There are three endpoints for users to access:

URL: https://usnames.herokuapp.com/api

To see an example of each, check out the following links: All Names - Males - Females

Luckily for you, to use this API there are no secret keys required. You can simply hit one of the endpoints to get the information you need. Let's get into the code.

Using jQuery

It isn't too difficult to difficult to grab API information with jQuery.

$.ajax({
  url: 'https://usnames.herokuapp.com/api/names/male',
  method: 'get',
  success: function(names) {
    console.log(names) 
  }
})

This snippet will pass an array of objects (male names) in the variable names and log it to the screen. It will look something like this:

[
   {
     _id: "5756815fbc5848057c9200d6",
     gender: "male",
     name: "alex"
   },
   {
     _id: "57568161f182f2087c706e2e",
     gender: "male",
     name: "mike"
   },
   {
     _id: "5756815fbc5848057c9200d4",
     gender: "male",
     name: "sam"
   },
   {
     ...
   }
]

From there, it is up to you how you use the names. 😉

WARNING: Running this code in the console of certain browsers (Chrome) will not work properly due to tighter security. But if your webpage is being served up from a server, you're good to go.

Don't See Your Name?

If your name is not in this API and you think it should be, tell me your name by sending a

Check Out Some Examples

* If you use this API, let me know so I can feature your project on the site. *