# Search MHRA (GOV.UK)

Search and read MHRA (GOV.UK) records through the Assyro API: MHRA guidance pages, Drug Safety Update articles and medical safety alerts published on GOV.UK.

Source: https://www.assyro.com/docs/sources/gov-uk-mhra

`GET https://api.assyro.com/v1/sources/gov-uk-mhra/search`

> **Note:** Preview: `api.assyro.com` is not serving production data yet. This page follows the API's published description and may change before launch.

Search and read MHRA (GOV.UK) records from your own code: MHRA guidance pages, Drug Safety Update articles and medical safety alerts published on GOV.UK. Published by Medicines and Healthcare products Regulatory Agency (GOV.UK) ([www.gov.uk/government/organisations/medicines-and-healthcare-products-regulatory-agency](https://www.gov.uk/government/organisations/medicines-and-healthcare-products-regulatory-agency)); answered from Assyro's copy, refreshed daily 04:00 UTC.

> **Warning:** Attribution required: every record carries `attribution`. Show it wherever you show the data: "Contains public sector information licensed under the Open Government Licence v3.0." See the [terms](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

Example: "What has MHRA said about valproate in Drug Safety Update?"

## Search

`GET https://api.assyro.com/v1/sources/gov-uk-mhra/search` with any of these query parameters. Repeat a parameter for a list (`?phase=PHASE2&phase=PHASE3`). An unknown parameter is refused by name.

### Search parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to find, e.g. "valproate pregnancy prevention" or "software as a medical device". Quoted phrases and OR work. |
| `collection` | string | no | Keep only one kind: guidance, drug-safety-update or safety-alerts. One of: `guidance`, `drug-safety-update`, `safety-alerts`. |
| `dateFrom` | string | no | Earliest first-published date (an alert's issue date), YYYY, YYYY-MM or YYYY-MM-DD. |
| `dateTo` | string | no | Latest first-published date (an alert's issue date), YYYY, YYYY-MM or YYYY-MM-DD. |
| `sort` | string | no | 'relevance' (default) or 'newest' for the most recently published first. One of: `relevance`, `newest`. |
| `limit` | integer | no | Pages to return, default 8. |
| `offset` | integer | no | Skip this many results (for paging), default 0. |

Each result is a record; read one in full with [Get a record](https://www.assyro.com/docs/sources/gov-uk-mhra/records).

## What a record holds

- `id`, `title`, `url`: the source's identifier, its title and its page at the source, to verify it.
- `authority`, `publishedDate`, `version`: who published it, when, and the edition read.
- `snippet` and `fields`: the matching text and the source's own fields.
- `asOf`: the day Assyro's copy of the source was read.
- `attribution`: the attribution the licence requires.

## Example request

curl:

```bash
curl "https://api.assyro.com/v1/sources/gov-uk-mhra/search?query=valproate&collection=drug-safety-update"
```

Python:

```python
import requests

response = requests.get(
    "https://api.assyro.com/v1/sources/gov-uk-mhra/search",
    params={
        "query": "valproate",
        "collection": "drug-safety-update"
    },
)
response.raise_for_status()
print(response.json())
```

JavaScript:

```javascript
const response = await fetch("https://api.assyro.com/v1/sources/gov-uk-mhra/search?query=valproate&collection=drug-safety-update");
const result = await response.json();
```
