BYTETOOLS

HAPI FHIR Test Server API

Free public HAPI FHIR R4 test server with no key: query Patient, Observation, Condition and every other FHIR resource against synthetic data. For development and learning only.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the HAPI FHIR Test Server API?

The HAPI FHIR public test server is a free, key-free FHIR R4 endpoint hosting synthetic healthcare data. It implements the full FHIR REST API — search, read, history and capability statements — so developers can build and test FHIR clients without provisioning a server or handling real patient data.

Learning FHIR is difficult without a server to talk to, and provisioning one is a substantial task in itself. This public instance removes that barrier: it speaks standard FHIR R4, so `GET /baseR4/Patient?_count=1` returns a proper searchset Bundle with paging links, exactly as a production server would. The data is synthetic, much of it generated by tools such as Synthea, and the example's patient is transparently named `Synthetic Patient SYN-000004`.

Treat it strictly as a sandbox. Anyone can write to it, records are periodically purged, and availability is best-effort — the same properties that make it convenient make it unsuitable for anything real. Critically, never post actual patient data: the server is world-readable, so writing identifiable information to it is a data breach in the most straightforward sense. The Bundle structure is worth studying while you are here, since `type: searchset`, the `link` array with its `next` relation, and the `entry[].search.mode` field distinguishing matched from included resources are the mechanics every FHIR client must handle.

Quick facts

Base URL
https://hapi.fhir.org/baseR4
Authentication
No API key or account — the server is deliberately open, including for writes. That openness is precisely why it must never receive real patient data. HAPI FHIR itself is open source under Apache 2.0.
Rate limit
No published limit, but this is a free community server with no availability guarantee and periodic data purges. Do not build anything that depends on it.
Pricing
Free. Run your own HAPI FHIR instance for anything beyond experimentation.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the HAPI FHIR Test Server API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Search for a patient resource and inspect the Bundle

GET https://hapi.fhir.org/baseR4/Patient?_count=1

curl
curl 'https://hapi.fhir.org/baseR4/Patient?_count=1' \
  -H 'Accept: application/fhir+json'
JavaScript (fetch)
const res = await fetch("https://hapi.fhir.org/baseR4/Patient?_count=1", {
  headers: {
    "Accept": "application/fhir+json",
  },
});
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

headers = {
    "Accept": "application/fhir+json",
}

res = requests.get("https://hapi.fhir.org/baseR4/Patient?_count=1", headers=headers, timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "resourceType": "Bundle",
  "id": "31725add-83b8-4c5a-8e55-1715feb914e1",
  "meta": {
    "lastUpdated": "2026-08-21T03:41:54.173-04:00"
  },
  "type": "searchset",
  "link": [
    {
      "relation": "self",
      "url": "https://hapi.fhir.org/baseR4/Patient?_count=1"
    },
    {
      "relation": "next",
      "url": "https://hapi.fhir.org/baseR4?_getpages=31725add-83b8-4c5a-8e55-1715feb914e1&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://hapi.fhir.org/baseR4/Patient/sindhu-syn-000004",
      "resource": {
        "resourceType": "Patient",
        "id": "sindhu-syn-000004",
        "meta": {
          "versionId": "6",
          "lastUpdated": "2026-07-31T02:45:12.904-04:00",
          "source": "#C75WT8HzGJLAXRKr",
          "tag": [
            {
              "system": "https://sindhu-ecrf.local/tags",
              "code": "sindhu-synthetic-40"
            }
          ]
        },
        "identifier": [
          {
            "system": "https://sindhu-ecrf.local/synthetic-patient-id",
            "value": "SYN-000004"
          }
        ],
        "active": true,
        "name": [
          {
            "text": "Synthetic Patient SYN-000004",
            "family": "SYN-000004",
            "given": [
              "Synthetic"
            ]
          }
        ],
        "gender": "male",
        "birthDate": "1952-01-01"
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
(resource type)path segmentRequiredAny FHIR R4 resource: `Patient`, `Observation`, `Condition`, `Encounter`, `Medication` and the rest. Patient
_countqueryOptionalPage size for a search. The server caps it regardless of what you ask for. 1
_idqueryOptionalSearch by resource logical id. sindhu-syn-000004
_lastUpdatedqueryOptionalFilter by modification time with FHIR prefixes such as `gt` and `lt`. gt2026-01-01
_include / _revincludequeryOptionalPull in referenced or referencing resources within the same Bundle. Observation:patient
_formatqueryOptional`json` or `xml`. Content negotiation via the Accept header also works. json
(endpoint) /metadatapathOptionalThe CapabilityStatement describing everything this server supports. /baseR4/metadata

Response fields

resourceTypestring
`Bundle` for search results. Every FHIR response identifies its own type this way.
typestring
`searchset` for a search. Other operations return `batch-response`, `history` and so on.
totalinteger
Total matches when the server computes it — not always present on large result sets.
link[]array
Paging links. Follow the entry whose `relation` is `next`; never construct paging URLs yourself.
entry[].fullUrlstring
Absolute URL of the resource, which is how you address it individually.
entry[].resourceobject
The resource itself, with its own `resourceType`, `id` and `meta`.
entry[].resource.meta.versionId / lastUpdatedstring
Version and modification time. FHIR resources are versioned and the history is retrievable.
entry[].search.modestring
`match` for resources meeting your criteria, `include` for ones pulled in by `_include`. Filtering on this matters when using includes.

What you can build with the HAPI FHIR Test Server API

  • Develop and test a FHIR client without provisioning a server
  • Learn FHIR search syntax and Bundle structure interactively
  • Prototype a healthcare integration before connecting to a real system
  • Validate that your FHIR resources conform before deployment
  • Demonstrate FHIR concepts in training material

Common errors and how to fix them

Data has disappeared

The test server is purged periodically.

Fix: Never rely on anything you wrote persisting. Recreate fixtures at the start of each test run, or run your own HAPI instance.

404 on a resource type

Not every FHIR resource is enabled.

Fix: Fetch `/baseR4/metadata` and read the CapabilityStatement. It is the authoritative list of what this server supports.

Search parameter ignored

FHIR search parameters are resource-specific.

Fix: Check the CapabilityStatement for the parameters that resource supports. Unknown parameters may be silently ignored rather than rejected.

Slow or unavailable

It is a free shared community server.

Fix: Expect variable performance and outages. Anything that matters should run against your own instance.

HAPI FHIR Test Server API — frequently asked questions

Is the HAPI FHIR test server free?

Yes, completely free with no key or account, and HAPI FHIR itself is open source under Apache 2.0. It is a community service with no uptime guarantee and periodic data purges.

Can I put real patient data on it?

Absolutely not. The server is world-readable and world-writable, so uploading identifiable patient information would expose it publicly and constitute a data breach. Everything on it should be synthetic.

What is FHIR?

Fast Healthcare Interoperability Resources, the HL7 standard for exchanging healthcare data over a REST API with JSON or XML payloads. It defines both the resource models — Patient, Observation, Condition — and the interaction patterns, which is why FHIR clients are portable across servers.

How do I know which resources and searches this server supports?

Request `/baseR4/metadata`, which returns a CapabilityStatement — a machine-readable declaration of every resource type, interaction and search parameter the server implements. Every conformant FHIR server publishes one.

Tools that pair with this API

HAPI FHIR Test Server is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.