# CDC API

> Returns CDC open datasets from data.cdc.gov with metadata, columns, rows, row counts, and syndicated content media types and topics.

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

CDC datasets on data.cdc.gov whose title or description matches a query, 10 per page by default.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as covid. (e.g. covid) |
| `limit` | integer | no | Items per page, 1 to 50. (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: `description` (string), `id` (string), `name` (string), `pageUrl` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/cdc/datasets?query=covid" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/cdc/dataset

Metadata and columns of one CDC dataset.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Dataset id, such as 9bhg-hcku. (e.g. 9bhg-hcku) |
| `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: `columns` (Column[]), `columns[].field` (string), `columns[].name` (string), `columns[].type` (string), `description` (string), `id` (string), `name` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/cdc/dataset?id=9bhg-hcku" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/cdc/rows

Rows of one CDC dataset, in the order the portal keeps them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Dataset id, such as 9bhg-hcku. (e.g. 9bhg-hcku) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `select` | string | no | SoQL $select, such as state, count(*). Supports count(), sum(), avg(), min(), max() and date_trunc_y, date_trunc_ym, date_trunc_ymd. |
| `where` | string | no | SoQL $where filter, such as year = '2020'. Also supports within_circle(). |
| `group` | string | no | SoQL $group, a column list to aggregate by. |
| `having` | string | no | SoQL $having filter on the aggregated rows. |
| `order` | string | no | SoQL $order, such as year DESC. Use it whenever paging deeply. |
| `query` | string | no | Full-text search across the whole row, SoQL $q. |
| `excludeSystemFields` | boolean | no | true drops Socrata's :computed_region and :id columns. (default false) |
| `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: `fields` (map)

```bash
curl "https://api.hoshime.com/v1/cdc/rows?id=9bhg-hcku" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/cdc/datasetCount

How many rows a CDC dataset holds, optionally only those matching a SoQL where filter.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Dataset id, such as 9bhg-hcku. (e.g. 9bhg-hcku) |
| `where` | string | no | SoQL $where filter, such as year = '2020'. Empty counts every row. |
| `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: `count` (integer (int64)), `id` (string)

```bash
curl "https://api.hoshime.com/v1/cdc/datasetCount?id=9bhg-hcku" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/cdc/contentMediaTypes

The media types of CDC syndicated content, such as Video or Infographic, that contentSearch accepts.

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: `count` (integer (int64)), `description` (string), `name` (string)

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

## GET /v1/cdc/contentTopics

The topics of CDC syndicated content, with their sub-topics as children; contentSearch takes their ids.

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. |
| `limit` | integer | no | Items per page, from 1 to 100. (default 20) |
| `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: `children` (Topic[]), `children[].children` (Topic[]), `children[].count` (integer (int64)), `children[].description` (string), `children[].id` (string), `children[].language` (string), `children[].name` (string), `count` (integer (int64)), `description` (string), `id` (string), `language` (string), `name` (string)

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

## GET /v1/cdc/contentSearch

CDC syndicated media items (Public Health Media Library), filtered by title, media type, topic or language.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | Exact item title. The whole title must match, not a part of it. |
| `mediaType` | string | no | Media type name from contentMediaTypes, such as Video. Comma-separated for several. (e.g. Video) |
| `topicId` | string | no | Topic id from contentTopics. Comma-separated for several. |
| `lang` | string | no | Language name, such as English or Spanish. |
| `sort` | string | no | Sort order: by publication date, newest or oldest; or by update, recentlyUpdated or leastRecentlyUpdated. (one of newest, oldest, recentlyUpdated, leastRecentlyUpdated; default newest) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, from 1 to 100. (default 20; e.g. 5) |
| `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: `attribution` (string), `datePublished` (string), `description` (string), `id` (string), `language` (string), `mediaType` (string), `name` (string), `syndicateUrl` (string), `thumbnailUrl` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/cdc/contentSearch?mediaType=Video&limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/cdc/content

One CDC syndicated media item by its id, with every field the library keeps.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `mediaId` | string | yes | Media item id, such as 766799, as contentSearch returns it. (e.g. 766799) |
| `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: `item` (MediaItem), `item.alternateImages` (AlternateImage[]), `item.alternateText` (string), `item.attribution` (string), `item.author` (string), `item.campaigns` (Ref[]), `item.childCount` (integer (int64)), `item.children` (Ref[]), `item.contentAuthoredAt` (string), `item.contentPublishedAt` (string), `item.contentReviewedAt` (string), `item.contentUpdatedAt` (string), `item.contentUrl` (string), `item.dataSize` (integer (int64)), `item.description` (string), `item.domainName` (string), `item.durationSeconds` (integer (int64)), `item.embedCode` (string), `item.embedUrl` (string), `item.enclosures` (Ref[]), `item.featuredText` (string), `item.geoTags` (Ref[]), `item.height` (integer (int64)), `item.id` (string), `item.isTopSyndicated` (boolean), `item.language` (Language), `item.length` (string), `item.maintainingOrgId` (string), `item.maintainingOrgName` (string), `item.mediaType` (string), `item.modifiedAt` (string), `item.name` (string), `item.noScriptText` (string), `item.omnitureChannel` (string), `item.owningOrgId` (string), `item.owningOrgName` (string), `item.pageCount` (integer (int64)), `item.parentCount` (integer (int64)), `item.parents` (Ref[]), `item.persistentUrl` (string), `item.persistentUrlToken` (string), `item.publishedAt` (string), `item.rating` (number (double)), `item.ratingCommentCount` (integer (int64)), `item.ratingCount` (integer (int64)), `item.size` (integer (int64)), `item.source` (Source), `item.sourceUrl` (string), `item.status` (string), `item.subTitle` (string), `item.syndicateUrl` (string), `item.syndicationCapturedAt` (string), `item.syndicationUpdatedAt` (string), `item.syndicationVisibleAt` (string), `item.tags` (Tag[]), `item.targetUrl` (string), `item.thumbnailUrl` (string), `item.url` (string), `item.width` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/cdc/content?mediaId=766799" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/cdc/travelNotices

CDC travel health notices (disease outbreaks, events and risks by destination, each marked Level 1 to 4 in its title), newest first.

Scope: `social:read` · Units: 1 · Cached: 60 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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `id` (string), `imageUrl` (string), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

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