DEV Community

Алексей Спинов
Алексей Спинов

Posted on

How to Scrape Government Data and Public Records (Free APIs)

Government data is free, legal, and structured. Here are the best sources.

US Government APIs

data.gov (10,000+ datasets)

https://catalog.data.gov/api/3/action/package_search?q=housing
Enter fullscreen mode Exit fullscreen mode

Census Bureau

https://api.census.gov/data/2020/acs/acs5?get=NAME,B01001_001E&for=state:*
Enter fullscreen mode Exit fullscreen mode

Bureau of Labor Statistics

async function getBLSData(seriesId) {
  const res = await fetch("https://api.bls.gov/publicAPI/v2/timeseries/data/", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ seriesid: [seriesId], startyear: "2023", endyear: "2026" })
  });
  return res.json();
}
Enter fullscreen mode Exit fullscreen mode

SEC EDGAR (Company Filings)

https://efts.sec.gov/LATEST/search-index?q=tesla&dateRange=custom&startdt=2026-01-01
Enter fullscreen mode Exit fullscreen mode

International

Source Data URL
World Bank Economic indicators api.worldbank.org
UN Data Demographics data.un.org
Eurostat EU statistics ec.europa.eu/eurostat
OECD Policy data data.oecd.org

Use Cases

  1. Market sizing with census data
  2. Economic trend analysis
  3. Regulatory research
  4. Grant/funding research
  5. Public health data analysis

Resources


Need government or public records data? $20-50. Email: Spinov001@gmail.com | Hire me

Top comments (0)