Skip to main content

Python SDK for publicsafetyapi.dev — US police stations, fire stations, hospitals, and EMS locations. Install: pip install publicsafetyapi · Import: from publicsafetyapi import PublicSafetyAPI

Project description

publicsafetyapi-sdk

Python SDK for publicsafetyapi.dev — the developer API for US public safety facility data.

Every police station, fire station, hospital, and EMS location in the United States — sourced from HIFLD (DHS/CISA) and CMS federal datasets — in a single clean REST API.


Installation

pip install publicsafetyapi-sdk

Quick Start

from publicsafetyapi import PublicSafetyAPI

client = PublicSafetyAPI(api_key="psk_live_...")

# Find the 5 nearest fire stations to any US address
stations = client.stations.nearby(
    address="12865 Main St, Apple Valley, CA",
    type="fire",
    radius_miles=10
)
for s in stations:
    print(f"{s.name}{s.distance_miles:.1f} mi")

# Which police department has jurisdiction over an address?
result = client.jurisdiction(
    address="12865 Main St, Apple Valley, CA",
    type="police"
)
print(result.likely_agencies[0].name)  # "Apple Valley Police Department"

# Look up any facility by ID
hospital = client.stations.get("hospital-hifld-112233")
print(hospital.trauma_level)    # "Level II"
print(hospital.beds)            # 212
print(hospital.cms_ccn)         # "050317"

What's Covered

Entity Type Source Records
Police stations HIFLD (DHS/CISA) 68,000+
Fire stations HIFLD (DHS/CISA) 55,000+
EMS stations HIFLD (DHS/CISA) 10,000+
Hospitals HIFLD + CMS 7,500+

API Key

Get a free API key (500 calls/month) at publicsafetyapi.dev.

Full SDK

The full SDK implementation ships with v0.2.0 alongside the API launch.
Sign up at publicsafetyapi.dev for early access.

Related

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

publicsafetyapi-0.2.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

publicsafetyapi-0.2.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file publicsafetyapi-0.2.0.tar.gz.

File metadata

  • Download URL: publicsafetyapi-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for publicsafetyapi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c9cfe6870401110f9fece20134232b42dc463ac7799dc14b7ec06b7b6863a598
MD5 1a64b9e4e5649a402b9ddcaa52461a30
BLAKE2b-256 f1640b0fc2ac113ce7d730ac03a58f753f585999943a55863f0ebc6281be89d5

See more details on using hashes here.

File details

Details for the file publicsafetyapi-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for publicsafetyapi-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 133e002bfc29377a2284d29ea8f6918590f1703e209f41fa1e7aec8916b068cc
MD5 ac52bd09f79673ae2adb0e411afde8b7
BLAKE2b-256 23165b4241498a5e7320cf79e8b5805d28df00a0b12b3b917b8c51250f74255b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page