> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metriport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Patient Data

> Search through a Patient's data and return matching resources

Searches through a Patient's consolidated data and returns resources that match the query. This
endpoint also includes CCDA documents.

The response contains a URL to a FHIR `searchset` bundle which contains the results of the search.

> [!WARNING]
>
> This feature is deprecated. If you need access to it,
> reach out to `support@metriport.com`.

> [!NOTE]
>
> The URL will only be valid for 60 seconds before you need
> to request a new one.

### How to use it

* the search is case-insensitive
* you can include multiple terms/words, separated by spaces
* it will include keywords that are very similar to the search criteria, accounting for typos
* it will return related resources

Example:

* search term: "pain medication"
* will include all resources with the words "pain" and "medication"

## Path Params

**id** `string` *required*

The ID of the Patient.

## Query Params

**query** `string`

The search query to match against the Patient's
consolidated data resources. If not provided, all
resources will be returned.

## Response

Returns a URL to download the FHIR bundle with the search results.

**url** `string`

The URL to download the FHIR `searchset` bundle. Not
present if no results were found.

**resourceCount** `number` *required*

The amount of resources resulting from the search.

```json theme={null}
{
  "url": "https://<url-to-download-the-search-bundle>",
  "resourceCount": 5
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.