Agencies

GEThttps://api-federal-contracts.dataandapis.com/v1/opportunities/agencies

Agencies is an endpoint of the Federal Contracts API. 86,500 active SAM.gov opportunities and 48,000 awards over $1M, searchable and refreshed daily.

Send your key in the X-Api-Key header. Each call costs 1 token; a free key includes 500 tokens a month.

Request

This endpoint takes no parameters.

Example request

curl
curl "https://api-federal-contracts.dataandapis.com/v1/opportunities/agencies" \
  -H "X-Api-Key: YOUR_API_KEY"
JavaScript / TypeScript (dataandapis package)
// npm install dataandapis
import { DataAndApis } from "dataandapis";

const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY

const data = await client.federalContracts.agencies();
Node.js (fetch)
const res = await fetch("https://api-federal-contracts.dataandapis.com/v1/opportunities/agencies", {
  headers: { "X-Api-Key": process.env.DATAANDAPIS_KEY },
});
const data = await res.json();
Python (dataandapis package)
# pip install dataandapis
from dataandapis import DataAndApis

client = DataAndApis()  # reads DATAANDAPIS_API_KEY

data = client.federal_contracts.agencies()
Python (requests)
import os, requests

r = requests.get(
    "https://api-federal-contracts.dataandapis.com/v1/opportunities/agencies",
    headers={"X-Api-Key": os.environ["DATAANDAPIS_KEY"]},
)
data = r.json()

Guide to the dataandapis npm package →Guide to the dataandapis Python package →

Example response

Example response
{
  "ok": true,
  "count": 6,
  "agencies": [
    {
      "agency": "DEPT OF DEFENSE",
      "notices": 56589,
      "active_notices": 56589
    },
    {
      "agency": "GENERAL SERVICES ADMINISTRATION",
      "notices": 8152,
      "active_notices": 8152
    },
    {
      "agency": "VETERANS AFFAIRS, DEPARTMENT OF",
      "notices": 6976,
      "active_notices": 6976
    },
    {
      "agency": "INTERIOR, DEPARTMENT OF THE",
      "notices": 2648,
      "active_notices": 2648
    },
    {
      "agency": "AGRICULTURE, DEPARTMENT OF",
      "notices": 2089,
      "active_notices": 2089
…
Show full response
{
  "ok": true,
  "count": 6,
  "agencies": [
    {
      "agency": "DEPT OF DEFENSE",
      "notices": 56589,
      "active_notices": 56589
    },
    {
      "agency": "GENERAL SERVICES ADMINISTRATION",
      "notices": 8152,
      "active_notices": 8152
    },
    {
      "agency": "VETERANS AFFAIRS, DEPARTMENT OF",
      "notices": 6976,
      "active_notices": 6976
    },
    {
      "agency": "INTERIOR, DEPARTMENT OF THE",
      "notices": 2648,
      "active_notices": 2648
    },
    {
      "agency": "AGRICULTURE, DEPARTMENT OF",
      "notices": 2089,
      "active_notices": 2089
    },
    {
      "agency": "HOMELAND SECURITY, DEPARTMENT OF",
      "notices": 1910,
      "active_notices": 1910
    }
  ]
}