FHIR Search Query Builder
Build FHIR search queries visually. Pick resources, modifiers, and parameters with autocomplete. Free, no signup.
- Compose FHIR search URLs from resource types, parameters, modifiers, and chaining.
- Copy the finished query straight into your client or terminal.
How to build a FHIR search query
- Set the server base URL. The default is the public HAPI FHIR R4 test server (
https://hapi.fhir.org/baseR4). - Choose a resource type.
- Add search parameters. For Patient, Observation, Condition, Encounter, MedicationRequest and DiagnosticReport, the parameter list offers that resource's standard search parameters. Choose a modifier (
:exact,:contains,:missing) or, for dates, a prefix (ge,le,gt,lt). - Copy the generated URL, or open it in a new tab to run it against the server.
The page itself sends nothing. A request is made only when you open the URL, and then it goes straight from your browser to the server you chose. Don't send real patient identifiers to a public test server.
Worked example
"Heart-rate observations for patient 123 since the start of 2026, newest first":
| Field | Value |
|---|---|
| Resource | Observation |
patient | 123 |
code | http://loinc.org|8867-4 |
date | prefix ge, value 2026-01-01 |
Generated URL:
https://hapi.fhir.org/baseR4/Observation?patient=123&code=http%3A%2F%2Floinc.org%7C8867-4&date=ge2026-01-01
Values are URL-encoded, so http://loinc.org|8867-4 appears as http%3A%2F%2Floinc.org%7C8867-4. Servers decode it back to the same thing, and encoding avoids problems with |, + and : in some clients and proxies.
Add &_sort=-date&_count=20 to the copied URL to get the newest results first, 20 per page.
The response is a searchset Bundle. If there are more results than one page, follow the link with relation: "next".
Things that make queries return the wrong results
- Misspelled parameters are ignored, not rejected, by most servers.
birthDate=1990(the parameter isbirthdate) returns every patient. Compare theselflink in the response with what you sent, or send the headerPrefer: handling=strict. - Codes are case-sensitive.
gender=Femalematches nothing. - String search is "starts with" by default.
name=shamatches Shaw and Shapiro. Use:exactfor an exact match. - Date precision matters.
birthdate=1990matches the whole year. AdateTimevalue with a time needs a timezone. - Token values should include the system (
system|code) so codes from different code systems can't collide.
Mastering FHIR Search covers every parameter type, chaining, _include and paging.
Limitations
- Parameter suggestions cover six common resource types. For other types, the resource's specification page (for example in the R4 reference) lists its search parameters.
- Result parameters (
_sort,_count,_include,_summary), chained parameters and_hasaren't in the form. Add them to the copied URL by hand. Composite parameters such ascomponent-code-value-quantitycan be picked, but you type their$-separated value yourself. - Opening the URL in a tab only works for servers that allow unauthenticated reads, such as public test servers. Production servers usually return 401 without a token. For those, use the URL in your own client with an access token (the SMART debugger helps you check one).
FAQ
Which FHIR version does it target?
Search syntax is the same in R4 and R5. Parameter names are R4 names; a few changed in R5, so check the server's CapabilityStatement (GET [base]/metadata) for what it supports.
Is the public HAPI server safe for real data?
No. It's a shared test server whose data is publicly visible and regularly reset. Use synthetic data only.
Does the page send my query anywhere?
Not by itself. Building the URL happens in the page. A request is made only when you open the URL, and then it goes directly from your browser to the server you chose.
Why does my query return everything?
Usually a parameter the server doesn't recognize, often a typo or wrong case. Most servers silently ignore unknown parameters. Compare the response's self link with your query, or send Prefer: handling=strict.
FHIR Toolbox is a free collection of HL7 FHIR tools by Omindra Labs. The tools process your data in your browser; it is not uploaded for normal tool operations.