# ClinicalTrials.gov API

> Returns clinical studies from ClinicalTrials.gov by search or NCT id, registry size statistics and common field values.

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

Clinical studies that match a search term, with the page's nextCursor.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search term, such as diabetes or a drug name. (e.g. diabetes) |
| `limit` | integer | no | Studies 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: `conditions` (string[]), `id` (string), `phases` (string[]), `sponsor` (string), `startDate` (string), `status` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/clinicaltrials/studies?query=diabetes" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/clinicaltrials/study

One clinical study by its NCT id, with its summary and interventions.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | NCT id of the study, such as NCT04280705. (e.g. NCT04280705) |
| `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: `conditions` (string[]), `id` (string), `interventions` (string[]), `officialTitle` (string), `phases` (string[]), `sponsor` (string), `startDate` (string), `status` (string), `summary` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/clinicaltrials/study?id=NCT04280705" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/clinicaltrials/studyEligibility

Who may join one clinical study: the eligibility criteria text, sex, age range and whether healthy volunteers are accepted.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | NCT id of the study, such as NCT04280705. (e.g. NCT04280705) |
| `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: `criteria` (string), `healthyVolunteers` (boolean), `maximumAge` (string), `minimumAge` (string), `sex` (string), `stdAges` (string[])

```bash
curl "https://api.hoshime.com/v1/clinicaltrials/studyEligibility?id=NCT04280705" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/clinicaltrials/studyOutcomes

What one clinical study measures: its primary and secondary outcomes with their description and time frame.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | NCT id of the study, such as NCT04280705. (e.g. NCT04280705) |
| `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), `measure` (string), `timeFrame` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/clinicaltrials/studyOutcomes?id=NCT04280705" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/clinicaltrials/studyLocations

Where one clinical study takes place: each site with its facility, city, state and country, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | NCT id of the study, such as NCT04280705. (e.g. NCT04280705) |
| `limit` | integer | no | Items per page, 1 to 200. (default 50) |
| `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: `city` (string), `country` (string), `facility` (string), `state` (string), `status` (string), `zip` (string)

```bash
curl "https://api.hoshime.com/v1/clinicaltrials/studyLocations?id=NCT04280705" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/clinicaltrials/sizeStats

How many studies the registry holds and the size of their records.

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

| 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: `averageSizeBytes` (integer (int64)), `totalStudies` (integer (int64))

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

## GET /v1/clinicaltrials/fieldValues

The most common values of one registry field across all studies, such as the trial phases.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `field` | string | yes | Field name as the registry names it, such as Phase, Status or StudyType. (e.g. Phase) |
| `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: `field` (string), `topValues` (FieldValue[]), `topValues[].studiesCount` (integer (int64)), `topValues[].value` (string), `uniqueValues` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/clinicaltrials/fieldValues?field=Phase" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
