County API
The County API enables you to look up detailed information for every county in the United States. You can search using various parameters including county name, ZIP code, or state.
From 2,421 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 388ms | 421ms | 462ms | 754ms | 1125ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/county GET
https://api.api-ninjas.com/v1/county
Returns details for one or more counties matching the input parameters. For premium users, you can also specify the limit and offset parameters to paginate through results.
Parameters
At least one of the following parameters (except limit and offset) must be set:
countyoptionalFull name of the county to search.
zipcodeoptional5-digit ZIP code to search.
stateoptional2-letter state code (case-insensitive).
limitoptional premium onlyNumber of results to return. Must be between
1and30. Default is1.offsetoptional premium onlyNumber of results to offset for pagination. Default is
0.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
county_nameName of the county.
county_fipsFIPS (Federal Information Processing Standards) code for the county.
state_code2-letter state code.
state_nameFull name of the state.
latitudepremium onlyLatitude coordinate of the centroid of the county.
longitudepremium onlyLongitude coordinate of the centroid of the county.
timezoneTimezone of the county (e.g., "America/Los_Angeles").
zip_codespremium onlyArray of ZIP codes within the county.
populationCounty population count.
median_ageMedian age of the county population.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/county?county=Multnomah CountyHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/county?county=Multnomah%20County" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Frequently Asked Questions
Can I use the County API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the County API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the County API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the County API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.How do I search for a specific county with the County API?
Send a GET request to/v1/countywith at least one of thecounty(full county name),zipcode(5-digit ZIP code), orstate(2-letter state code) parameters set. For broader location lookups you can also try the City API or Zip Code API.What information does the County API response include?
Each result returns fields such ascounty_name,county_fips,state_code,state_name,timezone,population, andmedian_age, whilelatitude,longitude, and thezip_codesarray are available to premium subscribers.Can I retrieve multiple counties in a single request?
Yes. Premium users can set thelimitparameter (between1and30, default1) along with theoffsetparameter to paginate through results; see pricing for plan details.What are some use cases for the County API?
It is useful for enriching addresses with FIPS codes viacounty_fips, building demographic dashboards usingpopulationandmedian_age, or mapping ZIP codes to counties; pair it with the Property Tax API for location-based financial tools or browse all API Ninjas APIs.