> ## 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`.
</Warning>

<Info>
  The URL will only be valid for 60 seconds before you need
  to request a new one.
</Info>

### 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

<ParamField path="id" type="string" required>
  The ID of the Patient.
</ParamField>

## Query Params

<ParamField query="query" type="string" optional>
  The search query to match against the Patient's
  consolidated data resources. If not provided, all
  resources will be returned.
</ParamField>

## Response

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

<ResponseField name="url" type="string" optional>
  The URL to download the FHIR `searchset` bundle. Not
  present if no results were found.
</ResponseField>

<ResponseField name="resourceCount" type="number" required>
  The amount of resources resulting from the search.
</ResponseField>

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