Hospitals API
DataMAINTAINED1 token / call

Hospitals API

5,419 Medicare-certified US hospitals with CMS star ratings, emergency services and coordinates

US hospital directory for 5,400+ Medicare-certified hospitals, built from official CMS Hospital Compare data enriched with geographic and infrastructure attributes: name, full address, county, phone, hospital type (acute care, critical access, psychiatric, childrens...), ownership, emergency services and birthing-friendly flags, CMS overall star rating (1-5) with mortality, safety, readmission, patient-experience and timeliness measure-group summaries β€” plus coordinates, bed counts, trauma-center level, helipad flag and website for the ~86% of hospitals geo-matched against the DHS HIFLD infrastructure layer. Search by name or city, filter by state, city, zip, county, type, ownership, emergency services, minimum star rating or trauma centers; find hospitals near any coordinate sorted by distance; aggregate states (with average rating) and hospital types. Self-hosted dataset refreshed daily from CMS β€” no third-party calls at request time.

Every call needs an X-Api-Key header. A free key includes 500 tokens a month, no card required. 1 token per call, so the free plan covers about 500 calls a month.

No credit card requiredAccess to 125+ APIsCancel anytime
response.json
{
  "total": 5419,
  "count": 1,
  "results": [
    {
      "ccn": "050625",
      "name": "CEDARS-SINAI MEDICAL CENTER",
      "address": {
        "city": "LOS ANGELES",
        "state": "CA"
      },
      "type": "Acute Care Hospitals",
      "emergencyServices": true,
      "overallRating": 5,
      "beds": 886
    }
  ]
}
Production Ready
Battle-tested infrastructure with a 99.9% uptime SLA. Rate limits are generous, responses are consistent.
Simple Integration
Standard REST + JSON. Works with any HTTP client. Copy-ready code snippets in 4 languages.
One Key, 125+ APIs
Your DataAndAPIs subscription unlocks every API on the platform β€” anime, finance, sports, and more.

Use cases for Hospitals API

  • Find the nearest emergency department to a patient's location in a telehealth or ambulance-dispatch tool.

  • Show CMS star ratings and safety, readmission and patient-experience summaries on a hospital comparison page.

  • Filter hospitals by type, ownership, trauma level or birthing-friendly flag for a referral directory.

  • Enrich claims or provider records with the hospital's address, phone, bed count and website from its CMS number.

Hospitals API endpoints

Every endpoint with its parameters and a real example response.

GETGet Hospital

https://api-hospitals.dataandapis.com/v1/hospitals/{ccn}

This endpoint takes no parameters.

Example request

curl "https://api-hospitals.dataandapis.com/v1/hospitals/{ccn}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ccn": "050625",
  "name": "CEDARS-SINAI MEDICAL CENTER",
  "address": {
    "street": "8700 BEVERLY BLVD",
    "city": "LOS ANGELES",
    "state": "CA",
    "zip": "90048",
    "county": "LOS ANGELES"
  },
  "phone": "(310) 423-3277",
  "type": "Acute Care Hospitals",
  "ownership": "Voluntary non-profit - Private",
  "emergencyServices": true,
  "overallRating": 5,
  "latitude": 34.0757,
  "longitude": -118.3803,
  "beds": 886,
  "birthingFriendly": true,
  "measureGroups": {
    "mortality": {
      "measures": 8,
      "better": 3,
      "no_different": 5,
      "worse": 0
    },
    "safety": {
      "measures": 8,
…
Show full response
{
  "ccn": "050625",
  "name": "CEDARS-SINAI MEDICAL CENTER",
  "address": {
    "street": "8700 BEVERLY BLVD",
    "city": "LOS ANGELES",
    "state": "CA",
    "zip": "90048",
    "county": "LOS ANGELES"
  },
  "phone": "(310) 423-3277",
  "type": "Acute Care Hospitals",
  "ownership": "Voluntary non-profit - Private",
  "emergencyServices": true,
  "overallRating": 5,
  "latitude": 34.0757,
  "longitude": -118.3803,
  "beds": 886,
  "birthingFriendly": true,
  "measureGroups": {
    "mortality": {
      "measures": 8,
      "better": 3,
      "no_different": 5,
      "worse": 0
    },
    "safety": {
      "measures": 8,
      "better": 4,
      "no_different": 4,
      "worse": 0
    },
    "readmission": {
      "measures": 11,
      "better": 2,
      "no_different": 8,
      "worse": 1
    },
    "patient_experience": {
      "measures": 15,
      "better": null,
      "no_different": null,
      "worse": null
    },
    "timely_effective": {
      "measures": 9,
      "better": null,
      "no_different": null,
      "worse": null
    }
  },
  "trauma": "LEVEL I",
  "helipad": true,
  "website": "https://www.cedars-sinai.org",
  "countyFips": "06037",
  "facilityOwner": "NON-PROFIT",
  "geoMatched": true
}

GETHospital Types

https://api-hospitals.dataandapis.com/v1/hospitals/types

This endpoint takes no parameters.

Example request

curl "https://api-hospitals.dataandapis.com/v1/hospitals/types" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "count": 8,
  "types": [
    {
      "type": "Acute Care Hospitals",
      "count": 3107
    },
    {
      "type": "Critical Access Hospitals",
      "count": 1382
    },
    {
      "type": "Psychiatric",
      "count": 624
    }
  ]
}

GETHospitals By State

https://api-hospitals.dataandapis.com/v1/hospitals/states

This endpoint takes no parameters.

Example request

curl "https://api-hospitals.dataandapis.com/v1/hospitals/states" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "count": 56,
  "states": [
    {
      "state": "TX",
      "count": 467,
      "avgRating": 3.38
    },
    {
      "state": "CA",
      "count": 377,
      "avgRating": 3.1
    },
    {
      "state": "FL",
      "count": 221,
      "avgRating": 3.06
    }
  ]
}

GETList Hospitals

https://api-hospitals.dataandapis.com/v1/hospitals

Query parameters

ParameterExample
cityLos AngelesOptional
countyLos AngelesOptional
emergencytrueOptional
limit20Optional
minRating4Optional
ownershipVoluntary non-profitOptional
page1Optional
qcedarsOptional
ratedtrueOptional
stateCAOptional
traumatrueOptional
typeAcute CareOptional
zip90048Optional

Example request

curl "https://api-hospitals.dataandapis.com/v1/hospitals?city=Los%20Angeles&county=Los%20Angeles&emergency=true&limit=20&minRating=4&ownership=Voluntary%20non-profit&page=1&q=cedars&rated=true&state=CA&trauma=true&type=Acute%20Care&zip=90048" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "total": 284,
  "page": 1,
  "limit": 20,
  "count": 1,
  "results": [
    {
      "ccn": "050625",
      "name": "CEDARS-SINAI MEDICAL CENTER",
      "address": {
        "street": "8700 BEVERLY BLVD",
        "city": "LOS ANGELES",
        "state": "CA",
        "zip": "90048",
        "county": "LOS ANGELES"
      },
      "phone": "(310) 423-3277",
      "type": "Acute Care Hospitals",
      "ownership": "Voluntary non-profit - Private",
      "emergencyServices": true,
      "overallRating": 5,
      "latitude": 34.0757,
      "longitude": -118.3803,
      "beds": 886
    }
  ]
}

GETNearby Hospitals

https://api-hospitals.dataandapis.com/v1/hospitals/nearby

Query parameters

ParameterExample
emergencytrueOptional
lat34.0522Required
limit10Optional
lon-118.2437Required
radius25Optional

Example request

curl "https://api-hospitals.dataandapis.com/v1/hospitals/nearby?emergency=true&lat=34.0522&limit=10&lon=-118.2437&radius=25" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "lat": 34.0522,
  "lon": -118.2437,
  "radiusKm": 10,
  "count": 2,
  "results": [
    {
      "ccn": "050149",
      "name": "CALIFORNIA HOSPITAL MEDICAL CENTER",
      "distanceKm": 2.6,
      "emergencyServices": true,
      "overallRating": 2,
      "beds": 318
    },
    {
      "ccn": "050557",
      "name": "EAST LOS ANGELES DOCTORS HOSPITAL",
      "distanceKm": 6.3,
      "emergencyServices": true,
      "overallRating": 3,
      "beds": 127
    }
  ]
}

GETRandom Hospitals

https://api-hospitals.dataandapis.com/v1/hospitals/random

Query parameters

ParameterExample
amount3Optional

Example request

curl "https://api-hospitals.dataandapis.com/v1/hospitals/random?amount=3" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "count": 2,
  "results": [
    {
      "ccn": "450054",
      "name": "BAYLOR UNIVERSITY MEDICAL CENTER",
      "address": {
        "city": "DALLAS",
        "state": "TX"
      },
      "type": "Acute Care Hospitals",
      "overallRating": 4
    },
    {
      "ccn": "141322",
      "name": "SARAH BUSH LINCOLN HEALTH CENTER",
      "address": {
        "city": "MATTOON",
        "state": "IL"
      },
      "type": "Critical Access Hospitals",
      "overallRating": null
    }
  ]
}

Where the data comes from

Source
CMS Hospital Compare general information and ratings, enriched with the DHS HIFLD hospitals layer for coordinates, beds, trauma level and helipad.
Freshness
CMS data re-synced daily. Geographic enrichment from the HIFLD release.

One install. Every endpoint.

No proprietary SDKs needed. Any HTTP client works. Pick your language and paste.

3languages
6endpoints
RESTarchitecture
1key for all APIs
  • Fully typed responses β€” auto-completion in your IDE
  • Tracks the API in lockstep β€” new endpoints land same day
  • One key works across 125+ APIs on the platform
import axios from 'axios';

const { data } = await axios.get(
  'https://api-hospitals.dataandapis.com/v1/hospitals/{ccn}',
  { headers: { 'X-Api-Key': process.env.API_KEY } }
);

Hospitals API Β· X-Api-Key

Explore the endpoints

Browse request parameters and inspect live example responses.

Available Endpoints

Request Parameters

API URL

Headers

X-Api-Key
import axios from 'axios';

const url = 'https://api-hospitals.dataandapis.com/v1/hospitals/{ccn}';
const { data } = await axios.get(url, {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' }
});

One subscription. Every API.

Tokens unlock this API and 125+ others on DataAndAPIs. Switch APIs any time β€” we promote.

FREE

$0/mo

500 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Community support
Start free
Most Popular

STARTER

$6.99/mo

25,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Email support
Subscribe

PRO

$24.99/mo

100,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Priority email support
Subscribe

ULTRA

$99.99/mo

1,000,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Priority support
Subscribe

Need higher volume, dedicated infra, or a custom contract? Talk to sales β†’

Questions about Hospitals API

Ship Hospitals API this afternoon.

500 free tokens. No card. Plus 125+ other APIs on the same key.