Get started with Leyr API in minutes. This guide walks you through common integration scenarios with complete, working code examples in Python and JavaScript.
By following these quickstart guides, you'll learn how to:
Before you start, you'll need:
Sign up for a free sandbox account to test the API.
Create AccountCreate a developer application to get your Client ID and Client Secret.
Connect to an EHR system and get your credentials. For testing, you can use Leyr's test credentials.
Configure EHRAll API requests require these headers:
import requests
# Your credentials from Leyr Developer Portal
CLIENT_ID = "your-client-id"
CLIENT_SECRET = "your-client-secret"
# Base URL for Leyr API
BASE_URL = "https://api.leyr.io/api"
# Headers for all requests
headers = {
"x-leyr-client-id": CLIENT_ID,
"x-leyr-client-secret": CLIENT_SECRET,
"Content-Type": "application/json"
}
# Example: Get list of supported EHRs
response = requests.get(f"{BASE_URL}/emrs", headers=headers)
emrs = response.json()
print(f"Available EHRs: {len(emrs)}")
Choose a use case to get started:
Find or Get Patient
Use this order to avoid missing required IDs:
care_unit_id (step 1), and discover resource_id, healthcare_service_id, and timeslots.patient_id.care_unit_id + timeslot + patient_idcare_unit_id + resource_id + patient_idcare_unit_id + resource_id + patient_idAfter completing these quickstarts, explore:
Getting Started
In a very brief, you only need 3 steps (with a prerequisite of registration in our Developer Portal) to call any EHR API through Leyr:
Show Doctor's Availability
Learn how to discover available timeslots for booking appointments. This guide walks through the complete flow from finding care units to checking doctor availability.