Before using this guide you will need a developer account and an access token. You can contact us about creating a developer account here. To get an access token, review the authentication and access tokens guide.
First you need to retrieve the list of active provider NPIs within your Zocdoc directory.
A Zocdoc directory is a developer-managed list of Zocdoc providers. Each developer account has at least one directory, and multiple directories can be created if needed to support your specific API use case.
The primary purpose of a directory is to define which providers are available for booking through your application. You can also use directories to explore the Zocdoc marketplace and identify providers you may want to include in your bookable directory.
- Sandbox
https://api-developer-sandbox.zocdoc.com/v1/reference/npi
- Production
https://api-developer.zocdoc.com/v1/reference/npi
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api-developer-sandbox.zocdoc.com/v1/reference/npi?page=0&page_size=60000' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Search by NPI
NPIs retrieved in the previous step can be used to fetch detailed provider information, including name, gender identity, spoken languages, specialties, visit reasons, and affiliated locations. Up to 50 NPIs can be queried in a single request.
- Sandbox
https://api-developer-sandbox.zocdoc.com/v1/providers
- Production
https://api-developer.zocdoc.com/v1/providers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api-developer-sandbox.zocdoc.com/v1/providers?npis=1234567891%2C0123456789&insurance_plan_id=ip_2224' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Search by ZIP and specialty or visit reason
If you don’t have NPIs, you can search by ZIP code and specialty or visit reason to find providers. This is beneficial when looking by distance or specifc reason.
- Sandbox
https://api-developer-sandbox.zocdoc.com/v1/provider_locations
- Production
https://api-developer.zocdoc.com/v1/provider_locations
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api-developer-sandbox.zocdoc.com/v1/provider_locations?zip_code=36925&specialty_id=sp_153&visit_reason_id=pc_FRO-18leckytNKtruw5dLR&page=0&page_size=10&insurance_plan_id=ip_2224&visit_type=all&max_distance_to_patient_mi=50' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Search by provider location
You can also retrieve provider information using specific provider_location_id
s. This is useful for patients who want to see a specific doctor at a specific location.
- Sandbox
https://api-developer-sandbox.zocdoc.com/v1/provider_locations/{provider_location_id}
- Production
https://api-developer.zocdoc.com/v1/provider_locations/{provider_location_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api-developer-sandbox.zocdoc.com/v1/provider_locations/pr_abc123-def456_wxyz7890|lo_abc123-def456_wxyz7890?insurance_plan_id=ip_2224' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Using the provider_location_id
and provider_id
you can set all slots for a given provider and date, replacing any existing slots. Submitting an empty request body will remove all slots for the given date. Ensure all open timeslots are included in the array for each date, per request. Subsequent requests for a single date will override previous data.
start_time
must be in UTC and time_zone
must be a valid IANA timezone.
- Sandbox
https://api-developer-sandbox.zocdoc.com/v1/providers/{provider_id}/calendar/timeslots
- Production
https://api-developer.zocdoc.com/v1/providers/{provider_id}/calendar/timeslots
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://api-developer-sandbox.zocdoc.com/v1/providers/pr_abc123-def456_wxyz7890/calendar/timeslots?date=2024-10-16' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"timeslots": [
{
"provider_id": "pr_abc123-def456_wxyz7890",
"location_id": "lo_abc123-def456_wxyz7890",
"start_time": "2024-10-16T09:30:00",
"time_zone": "America/New_York",
"allowed_visit_reason_ids": [
"pc_TlZW-r06U0W3pCsIGtSI5B"
],
"excluded_visit_reason_ids": [
"pc_TAZW-r16U0B3pZeIutSI3L"
],
"patient_type": "new"
}
]
}'