NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Hospitals API

The Hospitals API provides detailed information about hospitals in the United States including location, contact information, bed count, and more.

(4.5)

From 9,765 users

3,300+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
201ms233ms291ms676ms1073ms

Similar APIs

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.

  • name  optional

    Name of the hospital to search for. Supports partial matching.

  • city  optional

    City where the hospital is located.

  • state  optional

    State where the hospital is located.

  • zipcode  optional

    ZIP code of the hospital location.

  • county  optional

    County where the hospital is located.

  • min_latitude  optional

    Minimum latitude coordinate.

  • max_latitude  optional

    Maximum latitude coordinate.

  • min_longitude  optional

    Minimum longitude coordinate.

  • max_longitude  optional

    Maximum longitude coordinate.

  • limit  optional premium only

    Number of results to return. Default is 5. Maximum is 100.

  • offset  optional premium only

    Number of results to skip. Default is 0.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • name

    Hospital name.

  • care_type

    Type of care (for example Acute Care Hospitals).

  • address, city, state, zipcode

    Mailing address fields of the hospital.

  • county

    County where it is located.

  • location_area_code

    Telephone area code.

  • fips_code

    FIPS (Federal Information Processing Standard) county code.

  • timezone

    Local timezone for the site.

  • latitude, longitude

    Geographic coordinates of the hospital.

  • phone_number

    Main contact phone number in string format.

  • website

    Hospital website URL.

  • ownership

    Ownership / operator type (for example Voluntary non-profit - Private).

  • bedcount

    Number of staffed beds.

Sample Request Live Demo!

name
city
state
zipcode
county

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%20Hospital

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      name:"ROCHESTER GENERAL HOSPITAL",
      care_type:"Acute Care Hospitals",
      address:"1425 Portland Ave",
      city:"Rochester",
      state:"NY",
      zipcode:"14621",
      county:"Monroe",
      location_area_code:"585",
      fips_code:"36055",
      timezone:"EST",
      latitude:"43.1888",
      longitude:"-77.6040",
      phone_number:"(585) 922-4000",
      website:"http://www.viahealth.org/",
      ownership:"Voluntary non-profit - Private",
      bedcount:398
    },
    "..."
]

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

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • Each result includes the hospital's name, care_type, full mailing address (address, city, state, zipcode), county, fips_code, location_area_code, timezone, latitude and longitude coordinates, phone_number, website, ownership type, and bedcount; an unsuccessful request instead returns an error.
  • You can filter by name (which supports partial matching), city, state, zipcode, or county, and at least one parameter (other than offset) must be provided. For broader geographic lookups, pair these with our City, County, or Zip Code APIs.
  • Use the min_latitude, max_latitude, min_longitude, and max_longitude parameters to restrict results to a coordinate range; premium accounts can also raise the limit up to 100 results and use offset to page through more, while free accounts are capped at 5 results per request. See pricing for premium access details.
  • It is useful for building hospital locators and 'find care near me' tools, enriching healthcare directories with bedcount and ownership data, mapping facilities by latitude/longitude, and analyzing hospital capacity across a state or county. Browse other complementary data sources in our API catalog.