# USAspending API

> Returns US federal agencies, sub-components, awards and spending totals grouped by category from USAspending.gov.

Category: Government & Open Data. Region: US. 13 endpoints at `https://api.hoshime.com/v1/usaspending/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/usaspending
## GET /v1/usaspending/agencies

The top-tier federal agencies with their codes and current fiscal year budget authority.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `abbreviation` (string), `budgetAuthority` (string), `code` (string), `fiscalYear` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/agencies" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/agency

One top-tier federal agency: its name, mission, website and fiscal year.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Three-digit toptier agency code, such as 075. (e.g. 075) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `abbreviation` (string), `code` (string), `fiscalYear` (string), `mission` (string), `name` (string), `subtierAgencyCount` (integer (int64)), `website` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/agency?code=075" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/awards

Federal contract awards that start in a period, largest first.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `start` | string | yes | First day of the period as YYYY-MM-DD, such as 2024-01-01. (e.g. 2024-01-01) |
| `end` | string | yes | Last day of the period as YYYY-MM-DD, such as 2024-03-31. (e.g. 2024-03-31) |
| `limit` | integer | no | Awards per page, from 1 to 100. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `amount` (string), `generatedId` (string), `id` (string), `recipient` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/awards?start=2024-01-01&end=2024-03-31" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/award

One federal award by its generated id, such as CONT_AWD_…: its number, type, description, obligation, dates, agencies and recipient.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Generated unique award id, as listed by awards in generatedId. (e.g. CONT_AWD_DEAC0494AL85000_8900_-NONE-_-NONE-) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `awardNumber` (string), `awardingAgency` (string), `category` (string), `dateSigned` (string), `description` (string), `endDate` (string), `fundingAgency` (string), `id` (string), `recipient` (string), `recipientId` (string), `startDate` (string), `totalObligation` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/award?id=CONT_AWD_DEAC0494AL85000_8900_-NONE-_-NONE-" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/subComponents

The sub-components of one top-tier agency (such as the bureaus of a department) with their budget totals for a fiscal year.

Scope: `social:read` · Units: 1 · Cached: 360 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Three-digit toptier agency code, such as 075. (e.g. 075) |
| `fiscalYear` | integer | no | Fiscal year, such as 2024. (default 2024; e.g. 2024) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `fiscalYear` (integer (int64)), `items` (SubComponent[]), `items[].id` (string), `items[].name` (string), `items[].totalBudgetaryResources` (string), `items[].totalObligations` (string), `items[].totalOutlays` (string), `toptierCode` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/subComponents?code=075&fiscalYear=2024" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/agencyAwards

The award totals of one top-tier agency for a fiscal year: obligations, the number of transactions and the latest action date.

Scope: `social:read` · Units: 1 · Cached: 360 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Three-digit toptier agency code, such as 075. (e.g. 075) |
| `fiscalYear` | integer | no | Fiscal year, such as 2024. (default 2024; e.g. 2024) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `fiscalYear` (integer (int64)), `latestActionDate` (string), `obligations` (string), `toptierCode` (string), `transactionCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/usaspending/agencyAwards?code=075&fiscalYear=2024" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/spendingByCategory

Federal spending in a period grouped by one category (awarding agency, recipient, NAICS industry, product service code or state), largest first.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `category` | string | yes | awarding_agency, recipient, naics, psc or state_territory. (one of awarding_agency, recipient, naics, psc, state_territory; e.g. awarding_agency) |
| `start` | string | yes | First day of the period as YYYY-MM-DD, such as 2024-10-01. (e.g. 2024-10-01) |
| `end` | string | yes | Last day of the period as YYYY-MM-DD, such as 2025-09-30. (e.g. 2025-09-30) |
| `limit` | integer | no | Groups per page, from 1 to 100. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `amount` (string), `code` (string), `name` (string), `recipientId` (string), `slug` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/spendingByCategory?category=awarding_agency&start=2024-10-01&end=2025-09-30" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/spendingOverTime

Federal contract spending in a period over time, by fiscal year, quarter or month, in order of time.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `start` | string | yes | First day of the period as YYYY-MM-DD, such as 2024-01-01. (e.g. 2024-01-01) |
| `end` | string | yes | Last day of the period as YYYY-MM-DD, such as 2024-06-30. (e.g. 2024-06-30) |
| `group` | string | no | Length of each period: fiscal_year, quarter or month. (one of fiscal_year, quarter, month; default fiscal_year; e.g. month) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `amount` (string), `fiscalYear` (string), `month` (string), `quarter` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/spendingOverTime?start=2024-01-01&end=2024-06-30&group=month" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/recipient

One federal award recipient by its recipient id: names, identifiers, parent company, location and total federal awards.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Recipient id, as listed by awards in recipientId, such as 6cf5fb1b-…-C. (e.g. 6cf5fb1b-4988-d087-5dc1-70939d8fc6c4-C) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `alternateNames` (string[]), `city` (string), `duns` (string), `id` (string), `level` (string), `name` (string), `parentId` (string), `parentName` (string), `state` (string), `totalAmount` (string), `totalTransactions` (integer (int64)), `uei` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/recipient?id=6cf5fb1b-4988-d087-5dc1-70939d8fc6c4-C" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/recipientSearch

Federal award recipients whose name matches a search text, such as a company or university, with their UEI and DUNS numbers.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Part of a recipient name, such as lockheed. (e.g. lockheed) |
| `limit` | integer | no | Recipients, from 1 to 100. (default 10; e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `duns` (string), `name` (string), `uei` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/recipientSearch?query=lockheed&limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/naics

The NAICS industry codes used to classify federal awards, with the number of awards in each.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `count` (integer (int64)), `description` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/naics" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/glossary

The terms of the USAspending glossary with their plain-language definitions, 100 per page.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `plain` (string), `slug` (string), `term` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/glossary" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usaspending/budgetaryResources

The total budgetary resources of the federal government by fiscal year and period, newest first.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `fiscalPeriod` (integer (int64)), `fiscalYear` (integer (int64)), `total` (string)

```bash
curl "https://api.hoshime.com/v1/usaspending/budgetaryResources" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
