District of Columbia Open Data API

⭐ Beginner's Pick Government / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

The District of Columbia Open Data API gives you free access to hundreds of public datasets from the D.C. government, covering topics like crime statistics, GIS maps, and financial records. No API key is needed, making it a great starting point for beginners exploring real government data. You can use it to build data visualizations, research tools, or civic tech applications.

💡

Beginner Tip

Start by browsing the open data portal at opendata.dc.gov to find datasets of interest before calling the API endpoints. Most datasets support JSON output which is easy to parse in any language.

Available Data

District of Columbia Open Data data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from District of Columbia Open Data",
    "description": "Contains D.C. government public datasets, including crime, GIS, financial data, and so on",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

features Array of geographic feature objects, each containing attributes and geometry
attributes Key-value pairs of the dataset fields for each record, such as crime type, date, or location
geometry GIS coordinates (x, y or rings) representing the geographic location of the record
objectid Unique identifier for each record in the dataset
exceededTransferLimit True if more records exist beyond the current page; use resultOffset to fetch the next page

Implementation Example

const url = "http://opendata.dc.gov/pages/using-apis";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Empty or null response The query filter may be too restrictive or the dataset endpoint has changed
Check the D.C. Open Data portal for updated endpoint URLs and test with where=1=1 to return all records
CORS error in browser Some D.C. GIS endpoints restrict cross-origin browser requests
Make requests from a backend server or Node.js script instead of directly from a browser
Slow response or timeout Requesting too many records at once from large datasets
Add resultRecordCount=100 and use pagination with resultOffset to page through large datasets

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 264ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Government
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →