Find an API

Search public APIs with auth details & Postman guides

← All APIs

HAPI FHIR Test Server

hapi.fhir.org · Health

Health No Auth Free & Open Healthcare FHIR HL7

Public FHIR R4 test server for developers learning FHIR — create, read, update, and delete patients, observations, conditions, medications, and all FHIR resources. Free, no auth for public test data.

Authentication

No authentication requiredFree to use with no key needed.

Sample Requests

GET Search patients

Search for patients with surname Smith.

https://hapi.fhir.org/baseR4/Patient?_count=5&family=Smith&_format=json

Hover any highlighted part to learn what it does

curl -X GET "https://hapi.fhir.org/baseR4/Patient?_count=5&family=Smith&_format=json"
import requests
params = {
    "_count": "5",
    "family": "Smith",
    "_format": "json"
}
response = requests.get(
    "https://hapi.fhir.org/baseR4/Patient",
    params=params,
)
print(response.json())
const url = new URL('https://hapi.fhir.org/baseR4/Patient');
url.searchParams.set('_count', '5');
url.searchParams.set('family', 'Smith');
url.searchParams.set('_format', 'json');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://hapi.fhir.org/baseR4/Patient")
	q := baseURL.Query()
	q.Set("_count", "5")
	q.Set("family", "Smith")
	q.Set("_format", "json")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://hapi.fhir.org/baseR4/Patient")
uri.query = URI.encode_www_form({
  "_count" => "5",
  "family" => "Smith",
  "_format" => "json"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://hapi.fhir.org/baseR4/Patient?" . http_build_query([
    "_count" => "5",
    "family" => "Smith",
    "_format" => "json"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET Get observations

Get blood pressure observations (LOINC 55284-4).

https://hapi.fhir.org/baseR4/Observation?code=55284-4&_count=5&_format=json

Hover any highlighted part to learn what it does

curl -X GET "https://hapi.fhir.org/baseR4/Observation?code=55284-4&_count=5&_format=json"
import requests
params = {
    "code": "55284-4",
    "_count": "5",
    "_format": "json"
}
response = requests.get(
    "https://hapi.fhir.org/baseR4/Observation",
    params=params,
)
print(response.json())
const url = new URL('https://hapi.fhir.org/baseR4/Observation');
url.searchParams.set('code', '55284-4');
url.searchParams.set('_count', '5');
url.searchParams.set('_format', 'json');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://hapi.fhir.org/baseR4/Observation")
	q := baseURL.Query()
	q.Set("code", "55284-4")
	q.Set("_count", "5")
	q.Set("_format", "json")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://hapi.fhir.org/baseR4/Observation")
uri.query = URI.encode_www_form({
  "code" => "55284-4",
  "_count" => "5",
  "_format" => "json"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://hapi.fhir.org/baseR4/Observation?" . http_build_query([
    "code" => "55284-4",
    "_count" => "5",
    "_format" => "json"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. No API key needed
  2. Base URL: https://hapi.fhir.org/baseR4/
  3. Always add ?_format=json for JSON output
  4. Search patients: GET /Patient?name=john&_count=5&_format=json
  5. FHIR resources: Patient, Observation, Condition, Medication, Encounter, DiagnosticReport
  6. Never store real patient data on this public server

What can you build with HAPI FHIR Test Server?

HAPI FHIR Test Server is a Health API. Developers commonly use health APIs for:

  • accessing medical reference data and drug information
  • building patient-facing health tracking apps
  • integrating with EHR and telemedicine platforms
  • looking up ICD codes and clinical terminology
  • powering wellness and fitness applications

No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. HAPI FHIR Test Server is free to use, making it a low-risk choice to experiment with.

New to APIs? Read our beginner's guide

Open documentation ↗