# FEC API

> Returns US Federal Election Commission data on federal candidates and registered political committees.

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

Candidates for federal office (President, Senate, House) whose name contains the text.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Text in the candidate's name, such as obama. Empty lists every candidate. (e.g. obama) |
| `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: `activeThrough` (integer (int64)), `district` (string), `id` (string), `name` (string), `office` (string), `party` (string), `state` (string)

```bash
curl "https://api.hoshime.com/v1/fec/candidates?query=obama" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/fec/candidate

One candidate for federal office by FEC id: party, office, state, district and when the FEC first and last received filings.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | FEC candidate id, such as P80000722 (Joseph R. Biden). (e.g. P80000722) |
| `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: `activeThrough` (integer (int64)), `district` (string), `firstFileDate` (string), `id` (string), `incumbentChallenge` (string), `lastFileDate` (string), `name` (string), `office` (string), `party` (string), `state` (string), `status` (string)

```bash
curl "https://api.hoshime.com/v1/fec/candidate?id=P80000722" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/fec/committees

Political committees registered with the FEC (campaign, party, PAC) whose name contains the text.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Text in the committee's name, such as obama. Empty lists every committee. (e.g. obama) |
| `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: `designation` (string), `id` (string), `name` (string), `party` (string), `state` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/fec/committees?query=obama" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
