Hospitals API
The Hospitals API provides detailed information about hospitals in the United States including location, contact information, bed count, and more.
From 9,765 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 201ms | 233ms | 291ms | 676ms | 1073ms |
Didn't find what you were looking for? Suggest an improvement
/v1/hospitals GET
https://api.api-ninjas.com/v1/hospitals
Get hospital data based on given parameters. Returns a list of hospitals that match the specified criteria.
Parameters
At least one parameter (other than offset) must be provided. Free users are limited to 5 results per request. Premium users can use the limit parameter to get up to 100 results per request and can use the offset parameter to paginate through more results.
nameoptionalName of the hospital to search for. Supports partial matching.
cityoptionalCity where the hospital is located.
stateoptionalState where the hospital is located.
zipcodeoptionalZIP code of the hospital location.
countyoptionalCounty where the hospital is located.
min_latitudeoptionalMinimum latitude coordinate.
max_latitudeoptionalMaximum latitude coordinate.
min_longitudeoptionalMinimum longitude coordinate.
max_longitudeoptionalMaximum longitude coordinate.
limitoptional premium onlyNumber of results to return. Default is 5. Maximum is 100.
offsetoptional premium onlyNumber of results to skip. 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.
nameHospital name.
care_typeType of care (for example
Acute Care Hospitals).address,city,state,zipcodeMailing address fields of the hospital.
countyCounty where it is located.
location_area_codeTelephone area code.
fips_codeFIPS (Federal Information Processing Standard) county code.
timezoneLocal timezone for the site.
latitude,longitudeGeographic coordinates of the hospital.
phone_numberMain contact phone number in string format.
websiteHospital website URL.
ownershipOwnership / operator type (for example
Voluntary non-profit - Private).bedcountNumber of staffed beds.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/hospitals?name=General%20HospitalHeaders
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/hospitals?name=General%20Hospital" \
-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 Hospitals API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Hospitals 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 Hospitals 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 Hospitals 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.What data does the Hospitals API return for each hospital?
Each result includes the hospital'sname,care_type, full mailing address (address,city,state,zipcode),county,fips_code,location_area_code,timezone,latitudeandlongitudecoordinates,phone_number,website,ownershiptype, andbedcount; an unsuccessful request instead returns an error.How do I search for hospitals in a specific location?
How can I do a geographic bounding-box search and paginate through results?
Use themin_latitude,max_latitude,min_longitude, andmax_longitudeparameters to restrict results to a coordinate range; premium accounts can also raise thelimitup to 100 results and useoffsetto page through more, while free accounts are capped at 5 results per request. See pricing for premium access details.What are some use cases for the Hospitals API?
It is useful for building hospital locators and 'find care near me' tools, enriching healthcare directories withbedcountandownershipdata, mapping facilities bylatitude/longitude, and analyzing hospital capacity across astateorcounty. Browse other complementary data sources in our API catalog.