# openFDA API

> Returns FDA drug labels, adverse event reactions, food, device and drug recalls, and National Drug Code directory products.

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

FDA drug labels whose generic or brand name matches a drug.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Generic or brand name of the drug, such as aspirin. (e.g. aspirin) |
| `limit` | integer | no | Items per page, 1 to 10. (default 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: `brandName` (string), `genericName` (string), `id` (string), `indications` (string), `manufacturer` (string), `purpose` (string)

```bash
curl "https://api.hoshime.com/v1/openfda/drugLabels?name=aspirin" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfda/drugEvents

Reactions most often reported with a drug in FDA adverse event reports.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Generic name of the drug, such as aspirin. (e.g. aspirin) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `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)), `term` (string)

```bash
curl "https://api.hoshime.com/v1/openfda/drugEvents?name=aspirin" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfda/drugShortages

FDA drug shortage reports, newest first, with the status and the company of each. Give a generic name to narrow them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | Generic name of the drug, such as ibuprofen. Omit it for the newest shortages of every drug. |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `company` (string), `discontinuedDate` (string), `dosageForm` (string), `genericName` (string), `postedDate` (string), `reason` (string), `status` (string), `updateType` (string)

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

## GET /v1/openfda/drugApprovals

FDA-approved drug applications (Drugs@FDA) of a brand name: the application number, sponsor, products and their marketing status.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `brand` | string | yes | Brand name of the drug, such as Lipitor. (e.g. LIPITOR) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `applicationNumber` (string), `products` (Product[]), `products[].brandName` (string), `products[].dosageForm` (string), `products[].ingredients` (string[]), `products[].marketingStatus` (string), `products[].route` (string), `sponsor` (string)

```bash
curl "https://api.hoshime.com/v1/openfda/drugApprovals?brand=LIPITOR" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfda/foodRecalls

Latest FDA food enforcement reports (recalls).

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `classification` (string), `date` (string), `firm` (string), `id` (string), `productDescription` (string), `reason` (string), `state` (string), `status` (string)

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

## GET /v1/openfda/deviceRecalls

Latest FDA medical device recall reports.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `classification` (string), `date` (string), `firm` (string), `id` (string), `productDescription` (string), `reason` (string), `state` (string), `status` (string)

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

## GET /v1/openfda/deviceEvents

Adverse event and malfunction reports FDA received about a medical device, such as a catheter, newest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Generic name of the device, such as catheter or pacemaker. (e.g. catheter) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `brand` (string), `deviceName` (string), `eventDate` (string), `manufacturer` (string), `problems` (string[]), `receivedDate` (string), `reportNumber` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/openfda/deviceEvents?name=catheter" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfda/deviceClearances

FDA 510(k) premarket clearances of a medical device by its name: the applicant, the decision and its date.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Device name as the clearance lists it, such as catheter. (e.g. catheter) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `applicant` (string), `decision` (string), `decisionDate` (string), `deviceName` (string), `kNumber` (string), `productCode` (string)

```bash
curl "https://api.hoshime.com/v1/openfda/deviceClearances?name=catheter" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfda/drugRecalls

Latest FDA drug enforcement reports (recalls of medicines).

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `classification` (string), `date` (string), `firm` (string), `id` (string), `productDescription` (string), `reason` (string), `state` (string), `status` (string)

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

## GET /v1/openfda/ndc

Drug products in the National Drug Code directory with a generic name, with labeler and form.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Generic name of the drug, such as ibuprofen. (e.g. ibuprofen) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `activeIngredients` (integer (int64)), `brandName` (string), `dosageForm` (string), `genericName` (string), `labelerName` (string), `marketingCategory` (string), `productNdc` (string), `productType` (string)

```bash
curl "https://api.hoshime.com/v1/openfda/ndc?name=ibuprofen" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
