Skip to main content
RapidDev - Software Development Agency
v0-integrationsNext.js API Route

How to Integrate Zocdoc with V0

To use Zocdoc with V0, embed the Zocdoc booking widget via an iframe or script tag in your V0-generated Next.js pages. Zocdoc does not offer a fully public REST API — the primary integration path is the embeddable widget for scheduling, which requires a partnership agreement with Zocdoc. Use the widget embed for provider availability and appointment booking in your app.

What you'll learn

  • How to embed a Zocdoc booking widget or iframe in a V0-generated Next.js page
  • How to create a dynamic provider page layout in V0 that wraps the Zocdoc booking widget
  • How to handle the Zocdoc widget's URL parameters for pre-filling specialty and location
  • How to build a 'Find a Doctor' feature using V0 with Zocdoc's embeddable search widget
  • How to structure a Next.js API route for Zocdoc partner API access if you have a partnership
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate16 min read20 minutesOtherApril 2026RapidDev Engineering Team
TL;DR

To use Zocdoc with V0, embed the Zocdoc booking widget via an iframe or script tag in your V0-generated Next.js pages. Zocdoc does not offer a fully public REST API — the primary integration path is the embeddable widget for scheduling, which requires a partnership agreement with Zocdoc. Use the widget embed for provider availability and appointment booking in your app.

Embedding Zocdoc Doctor Booking in Your V0-Built Healthcare App

Zocdoc is the dominant doctor booking platform in the United States, connecting patients with physicians across more than 100 specialties. For founders building healthcare apps with V0, embedding Zocdoc booking capabilities means your users can schedule appointments directly within your product rather than being sent to an external website. The integration approach is different from most APIs covered in these guides — Zocdoc does not offer an open public REST API. Instead, they provide embeddable booking widgets to registered healthcare providers and official partners.

There are two distinct paths depending on your situation. If you are a healthcare provider or clinic that already has a Zocdoc account, you can embed your provider profile's booking widget directly in your website. Zocdoc provides a JavaScript snippet or iframe embed code from your provider portal. V0 handles building the surrounding page layout — the hero section, provider bio, insurance information display — while the Zocdoc widget handles appointment selection and patient intake.

If you are building a healthcare marketplace or aggregator app that needs to display multiple providers and booking availability, you will need to apply for Zocdoc's API partner program. The partner API provides programmatic access to provider listings, availability slots, and booking flows. Partner API credentials are different from regular Zocdoc accounts and must be configured as server-side environment variables in your Vercel project. V0's limitation here is the same as with any data-heavy integration: V0 can generate beautiful UI scaffolding quickly, but the complex state management for real-time availability grids typically needs refinement after the initial generation.

Integration method

Next.js API Route

Zocdoc's primary integration path for embedding in external apps is through a JavaScript widget or iframe that Zocdoc provides to registered healthcare providers and partners. V0 generates the page layout and surrounding UI, while the Zocdoc widget handles the actual booking flow inside an embedded container. For partners with API access, a Next.js API route proxies requests to the Zocdoc API using partner credentials stored in Vercel environment variables.

Prerequisites

  • A V0 account at v0.dev with a Next.js project
  • A Zocdoc provider account (for basic widget embedding) OR a Zocdoc Partner API account (for programmatic access)
  • Your Zocdoc widget embed code or partner API credentials from your Zocdoc account
  • A Vercel account with your V0 project deployed via GitHub
  • For partner API access: completed Zocdoc API partner application at developer.zocdoc.com

Step-by-step guide

1

Design the Provider Page Layout with V0

Start by using V0 to generate the surrounding page layout for the Zocdoc booking widget. The widget itself is a fixed-size embedded element from Zocdoc, but it needs a well-designed page context to feel like a native part of your app. V0 is excellent at building these surrounding layouts: provider bio sections, insurance lists, office hours, map embeds, and review summaries. When prompting V0, describe the full page including a placeholder container for the booking widget. Use a specific placeholder like a gray rounded box with explicit dimensions — Zocdoc booking widgets are typically around 380px wide and 500-600px tall on desktop. This placeholder will be replaced with the actual Zocdoc widget code after V0 generates the page layout. For provider pages, the booking widget container should be prominently placed, typically in a right-side column on desktop and stacked below the provider details on mobile. Ask V0 to make the layout responsive. The booking container should not have any CSS overflow hidden or maximum height constraints — Zocdoc's widget may need to expand to show a multi-step booking form including insurance selection and reason for visit. V0-generated layouts may add overly aggressive box-shadow or border-radius styles to embedded containers that conflict with the Zocdoc widget's own styling. If the widget looks clipped after embedding, ask V0 to remove padding and overflow constraints from the widget container element. The widget works best inside a plain div with only width and height constraints.

V0 Prompt

Create a healthcare provider profile page layout. Left column (60% width on desktop): Provider name 'Dr. James Wilson, MD', specialty 'Internal Medicine', a row of three stats (15 Years Experience / 4.8 Stars / 500+ Reviews), tabbed section with About/Insurance/Location tabs, and the About tab content showing two paragraphs of placeholder text. Right column (40% width): sticky card with heading 'Schedule an Appointment', a div with id='zocdoc-widget' with minimum height 500px and light gray background, and below it a small text 'Powered by Zocdoc'. Make it responsive so columns stack on mobile.

Paste this in V0 chat

Pro tip: Use a placeholder background color in the widget container div during development so you can see exactly where the widget will appear before the Zocdoc script loads.

Expected result: V0 generates a polished healthcare provider page with a clearly defined widget container area, responsive layout, and professional medical aesthetic.

2

Embed the Zocdoc Widget Script

Once the page layout is in place, add the actual Zocdoc embedding code. Zocdoc provides embeddable booking widgets to healthcare providers through their provider portal. The embed mechanism depends on your Zocdoc account type: most providers receive either an iframe snippet or a JavaScript widget that renders into a target element. For iframe-based embeds, the integration is straightforward — replace the placeholder div with an HTML iframe element pointing to your Zocdoc booking URL. The URL pattern for direct provider booking pages is https://www.zocdoc.com/practice/{practice-id}/booking and can be embedded directly. In Next.js, you can use an iframe element directly in your React component. For JavaScript widget embeds (available to providers and partners), create a client component in your Next.js app that loads the Zocdoc script after the component mounts. Use a useEffect hook to append the script tag to the document and initialize the widget with your provider or widget configuration. This approach gives Zocdoc's widget access to the DOM element with the correct ID to render into. A V0-specific consideration: if you ask V0 to add the Zocdoc script to the page, it may generate code that tries to load the script in a Server Component using next/script. Because the Zocdoc widget interacts with the DOM and accesses browser APIs, the component loading the script must be a client component with the 'use client' directive at the top. If V0 generates a server component version, add 'use client' at the top of the file and add a useEffect for the script initialization. For healthcare organizations building more complex appointment management systems that integrate Zocdoc with patient records and scheduling back-ends, RapidDev's team can assist with both the V0 UI generation and the API route architecture to connect Zocdoc partner APIs with internal healthcare systems.

V0 Prompt

Create a ZendeskBookingWidget component at components/zocdoc-widget.tsx. Use 'use client' and import useEffect. In useEffect, create a script element with the Zocdoc widget script URL from the NEXT_PUBLIC_ZOCDOC_WIDGET_URL environment variable, set it as async, and append it to document.body. Also call any initialization function with the target element ID 'zocdoc-widget' and the provider ID from NEXT_PUBLIC_ZOCDOC_PROVIDER_ID. Return a div with id='zocdoc-widget' and className='w-full min-h-[500px]'.

Paste this in V0 chat

components/zocdoc-widget.tsx
1'use client';
2
3import { useEffect } from 'react';
4
5interface ZocdocWidgetProps {
6 providerId?: string;
7 widgetHeight?: number;
8}
9
10export function ZocdocWidget({ providerId, widgetHeight = 520 }: ZocdocWidgetProps) {
11 const resolvedProviderId = providerId || process.env.NEXT_PUBLIC_ZOCDOC_PROVIDER_ID;
12
13 useEffect(() => {
14 if (!resolvedProviderId) {
15 console.warn('ZocdocWidget: No provider ID configured');
16 return;
17 }
18
19 // Load Zocdoc widget script
20 const scriptId = 'zocdoc-widget-script';
21 if (document.getElementById(scriptId)) return; // Prevent duplicate loading
22
23 const script = document.createElement('script');
24 script.id = scriptId;
25 // Use your actual Zocdoc widget script URL from the provider portal
26 script.src = process.env.NEXT_PUBLIC_ZOCDOC_WIDGET_URL || 'https://www.zocdoc.com/widget/js/widget.js';
27 script.async = true;
28 script.onload = () => {
29 // Initialize widget after script loads
30 if (typeof window !== 'undefined' && (window as Record<string, unknown>).ZocdocWidget) {
31 const ZW = (window as Record<string, unknown>).ZocdocWidget as {
32 init: (config: { containerId: string; providerId: string }) => void;
33 };
34 ZW.init({
35 containerId: 'zocdoc-booking-container',
36 providerId: resolvedProviderId,
37 });
38 }
39 };
40 document.body.appendChild(script);
41 }, [resolvedProviderId]);
42
43 return (
44 <div
45 id="zocdoc-booking-container"
46 style={{ minHeight: widgetHeight, width: '100%' }}
47 className="bg-gray-50 rounded-lg"
48 />
49 );
50}

Pro tip: The exact script URL and initialization API for Zocdoc's widget varies by account type. Get the specific embed code from your Zocdoc provider portal — do not guess the script URL.

Expected result: The ZocdocWidget component renders on the page with a placeholder container. After the script loads, the actual Zocdoc booking interface appears inside the container with available appointment times.

3

Configure Environment Variables and Widget Parameters

Set up the environment variables that control which provider or widget configuration is loaded. For basic widget embedding, these are public-facing identifiers (safe to include in client-side code with NEXT_PUBLIC_) — they identify which provider's booking interface to show, not any secret credentials. In Vercel Dashboard → Settings → Environment Variables, add: NEXT_PUBLIC_ZOCDOC_PROVIDER_ID: Your Zocdoc provider or practice ID. This is a public identifier visible in your Zocdoc booking URLs — for example, in zocdoc.com/doctor/james-wilson-md-123, the identifier is embedded in the path. Get the canonical ID from your Zocdoc provider portal. NEXT_PUBLIC_ZOCDOC_WIDGET_URL: The URL of the Zocdoc widget JavaScript file. Zocdoc provides this in your provider portal when you set up the web embedding option. This is a public CDN URL. For Zocdoc Partner API access (if you have a partnership agreement), also add: ZOCDOC_API_KEY: Your partner API key without any NEXT_PUBLIC_ prefix — this is a server-side secret that must only be used in Next.js API routes. ZOCDOC_API_BASE_URL: The partner API base URL provided by Zocdoc's developer program. The distinction between NEXT_PUBLIC_ variables (widget identifiers, OK to be public) and server-only variables (API keys) is critical. Your provider ID appearing in HTML is expected and harmless — your API key appearing in HTML would allow anyone to make authenticated API calls on your behalf.

.env.local
1# .env.local local development
2# Public identifiers (safe in browser)
3NEXT_PUBLIC_ZOCDOC_PROVIDER_ID=your_provider_id
4NEXT_PUBLIC_ZOCDOC_WIDGET_URL=https://www.zocdoc.com/widget/js/widget.js
5
6# Partner API credentials server-only, no NEXT_PUBLIC_ prefix
7ZOCDOC_API_KEY=your_partner_api_key
8ZOCDOC_API_BASE_URL=https://api.zocdoc.com

Pro tip: Check your browser's Network tab after the page loads to confirm the Zocdoc widget script is being requested and returning a 200 status. If it returns 404, the NEXT_PUBLIC_ZOCDOC_WIDGET_URL is incorrect.

Expected result: Environment variables are saved in Vercel. The widget component uses NEXT_PUBLIC_ZOCDOC_PROVIDER_ID to initialize the correct provider's booking interface.

4

Build a Partner API Route (For Zocdoc Partners Only)

If you have been approved for the Zocdoc Partner API program, you can build a Next.js API route that queries provider availability, searches for doctors, and initiates the booking process programmatically — giving you much more UI flexibility than the embedded widget. Create app/api/zocdoc/search/route.ts to handle doctor search queries. The Zocdoc partner API (available at the base URL provided by Zocdoc) accepts parameters like specialty, insurance_carrier, location (latitude/longitude or zip code), and date range. The API returns provider listings with availability slots that you can display in your custom V0-generated UI. Authentication for the partner API uses your API key, typically as an Authorization header or as an x-api-key header — the exact mechanism depends on your partnership agreement and the API version you have access to. Store the key in ZOCDOC_API_KEY (server-side only, no NEXT_PUBLIC_ prefix) and include it in the Authorization header of each API call. Because Zocdoc's partner API returns real-time availability data that changes frequently, do not cache responses for more than 60 seconds — a cached 'available' slot could already be booked by another patient. Use Next.js route segment config with export const revalidate = 0 to ensure fresh data on every request. Note that as of 2026, Zocdoc's public API access is restricted to approved partners. If you are building a consumer healthcare app and need broader provider data, the widget embed approach is the path of least resistance while you work through the partnership application process.

V0 Prompt

Create a Next.js API route at app/api/zocdoc/search/route.ts that accepts GET requests with query parameters: specialty, location, insurance, and date. Call the Zocdoc partner API using ZOCDOC_API_KEY and ZOCDOC_API_BASE_URL from environment variables. Return an array of providers with their names, specialties, available appointment slots, and booking URLs.

Paste this in V0 chat

app/api/zocdoc/search/route.ts
1import { NextRequest, NextResponse } from 'next/server';
2
3export const revalidate = 0; // Always fetch fresh availability data
4
5export async function GET(request: NextRequest) {
6 const { searchParams } = new URL(request.url);
7 const specialty = searchParams.get('specialty');
8 const location = searchParams.get('location');
9 const insurance = searchParams.get('insurance');
10 const date = searchParams.get('date');
11
12 if (!specialty || !location) {
13 return NextResponse.json(
14 { error: 'specialty and location are required' },
15 { status: 400 }
16 );
17 }
18
19 try {
20 const params = new URLSearchParams({
21 specialty,
22 location,
23 ...(insurance && { insurance }),
24 ...(date && { date }),
25 });
26
27 const response = await fetch(
28 `${process.env.ZOCDOC_API_BASE_URL}/providers/search?${params}`,
29 {
30 headers: {
31 Authorization: `Bearer ${process.env.ZOCDOC_API_KEY}`,
32 'Content-Type': 'application/json',
33 },
34 cache: 'no-store',
35 }
36 );
37
38 if (!response.ok) {
39 return NextResponse.json(
40 { error: `Zocdoc API error: ${response.status}` },
41 { status: response.status }
42 );
43 }
44
45 const data = await response.json();
46 return NextResponse.json(data);
47 } catch (error) {
48 console.error('Zocdoc search error:', error);
49 return NextResponse.json(
50 { error: 'Failed to search providers' },
51 { status: 500 }
52 );
53 }
54}

Pro tip: Add request deduplication in your API route to avoid firing multiple simultaneous search requests when users rapidly change specialty or location filters.

Expected result: The partner API route accepts search parameters and returns provider availability data. The V0-generated search UI displays real provider names, specialties, and available appointment times.

Common use cases

Healthcare Provider Website with Embedded Booking

A doctor's office or clinic wants to add online booking to their V0-built website. V0 generates the provider profile page with the practice details, accepted insurance, and location. The Zocdoc booking widget is embedded in a card on the page, allowing patients to see availability and book without leaving the site.

V0 Prompt

Create a doctor profile page for Dr. Sarah Chen, Cardiologist. Include: a hero section with doctor photo placeholder (circle avatar), name, specialty badge, and years of experience. Below, add two columns: left column with 'About' text and 'Accepted Insurance' list, right column with a white card labeled 'Book an Appointment' with a gray placeholder area that says 'Zocdoc widget loads here' and dimensions 380px by 520px. Add a 'View on Zocdoc' button below the card. Use a clean medical aesthetic with blue accents.

Copy this prompt to try it in V0

Find a Doctor Search Page

A healthcare app wants a doctor search feature. V0 generates the search interface with specialty dropdown, location input, and insurance filter. Submitting the search redirects to the Zocdoc search results page (or embeds the Zocdoc search widget if the app has partner API access) pre-filtered with the user's criteria.

V0 Prompt

Build a 'Find a Doctor' search page. Include a prominent search form with: a Specialty dropdown with options like Primary Care, Dermatology, Cardiology, OB-GYN, Orthopedics, and 10 more common specialties. A Location input with a 'Use my location' GPS icon button. An Insurance dropdown with common insurance names. A large 'Search Doctors' button. Below the form, add three provider result cards as placeholders showing doctor name, specialty, rating stars, distance, and 'Book Now' button. The 'Book Now' button links to /api/zocdoc/booking with the provider ID as a query parameter.

Copy this prompt to try it in V0

Telemedicine Appointment Scheduler

A telehealth startup builds a V0 app that lets patients schedule virtual visits. V0 generates the appointment type selection screen and the confirmation page. The Zocdoc virtual visit booking widget is embedded in the scheduling step, and after confirmation, the app displays the appointment details in its own UI.

V0 Prompt

Create a telemedicine scheduling flow. Step 1: A card grid showing appointment types (Video Visit, Phone Consultation, In-Person) with icons and price ranges. Step 2: After selecting Video Visit, show a centered scheduling card with a 'Available Times' header and a placeholder grid of time slots for the next 7 days (show Mon-Sun as column headers, three time slot buttons per day). Include a 'Next: Patient Info' button at the bottom. Connect the time slot selection to POST /api/zocdoc/book-appointment.

Copy this prompt to try it in V0

Troubleshooting

The Zocdoc widget container is blank — no booking interface appears

Cause: Either the widget script failed to load, the provider ID is incorrect, or the widget initialization function was called before the script finished loading.

Solution: Open the browser's Network tab and check if the Zocdoc script URL returned a 200 response. Check the browser console for JavaScript errors. Verify NEXT_PUBLIC_ZOCDOC_PROVIDER_ID matches the ID shown in your Zocdoc provider portal. Ensure the widget initialization is called inside the script's onload callback, not immediately after appending the script tag.

Widget loads but shows 'Provider not found' or similar error

Cause: The provider ID in NEXT_PUBLIC_ZOCDOC_PROVIDER_ID does not match a valid provider in the Zocdoc system, or the provider's account does not have web widget embedding enabled.

Solution: Log into your Zocdoc provider portal and navigate to the web widget settings to confirm embedding is enabled and copy the exact provider/widget ID they specify. Contact Zocdoc support if the widget embedding option is not visible in your portal.

Widget works locally but does not appear on the deployed Vercel site

Cause: NEXT_PUBLIC_ZOCDOC_PROVIDER_ID or NEXT_PUBLIC_ZOCDOC_WIDGET_URL environment variables are not set in Vercel's Production environment, only in local .env.local.

Solution: In Vercel Dashboard → Settings → Environment Variables, verify both NEXT_PUBLIC_ variables are set for the Production environment. Redeploy after adding them. Check the Vercel deployment build logs to confirm the variables were available during the build.

V0 generates a Server Component for the widget but the script fails to load

Cause: Zocdoc's widget script uses browser DOM APIs that are only available client-side. Server Components in Next.js render on the server where window, document, and DOM are not available.

Solution: Add 'use client' as the first line of the widget component file. This marks the component as a Client Component that renders in the browser. If the entire page was generated as a server component by V0, wrap just the widget portion in a separate client component file.

typescript
1// Add to the very first line of the widget component file
2'use client';

Best practices

  • Keep provider IDs and widget script URLs as NEXT_PUBLIC_ variables since they are public identifiers, not secrets — but never put partner API keys with NEXT_PUBLIC_ prefix.
  • Always load the Zocdoc widget script inside a useEffect hook in a client component to ensure the DOM is ready before the script tries to access it.
  • Add a visible loading placeholder in the widget container div so users see that booking is loading rather than a confusing blank space.
  • Prevent duplicate script loading by checking for an existing script element with your script ID before appending a new one.
  • For partner API searches, never cache availability data for more than 60 seconds — appointment slots change in real time.
  • Design the surrounding provider profile page in V0 to be fully useful without the widget loading — include phone number, address, and office hours so users can contact the provider even if the widget fails to load.
  • Test the widget on both mobile and desktop — Zocdoc widgets may have different minimum width requirements that affect the layout.
  • Contact Zocdoc's developer support team early in your project if you plan to use the partner API — approval processes can take weeks.

Alternatives

Frequently asked questions

Does Zocdoc have a public API I can use without a partnership agreement?

As of 2026, Zocdoc does not offer an open public REST API for general developer access. The partner API requires applying to Zocdoc's developer program and being approved. For most healthcare providers and clinics, the embeddable booking widget is the primary integration path and requires a standard Zocdoc provider account rather than a partnership agreement.

Can V0 generate the Zocdoc integration code automatically?

V0 can generate the surrounding page layout, the widget container structure, and the client component boilerplate for loading external scripts. However, V0 will not know your specific Zocdoc provider ID or widget script URL — you need to supply those from your Zocdoc provider portal. The generated code should be verified against Zocdoc's current documentation since widget APIs change over time.

Is the Zocdoc booking widget HIPAA compliant?

Zocdoc maintains HIPAA compliance for the data collected through its booking flows. However, the compliance obligations for your overall application depend on how you store and handle patient data outside of the Zocdoc widget. If your V0 app stores appointment information or health data, you need your own HIPAA compliance measures independent of what Zocdoc handles in the widget.

Can I customize the Zocdoc widget's appearance to match my app's design?

The Zocdoc widget's appearance is largely controlled by Zocdoc's own styling. Provider-facing customization options (like colors and logo) may be available through your Zocdoc account settings, but you cannot fully restyle the widget using CSS from your app. The standard approach is to build a visually cohesive surrounding page with V0 while accepting the Zocdoc widget's native styling.

How do I test the Zocdoc widget integration without real patient bookings?

Zocdoc does not provide a sandbox environment for general provider accounts. For testing, use your Zocdoc provider portal in a test or staging configuration if available, or test with your own email address as the patient. Check with Zocdoc support about available testing options — partner API accounts typically have a sandbox environment.

What if my app needs to show Zocdoc availability alongside non-Zocdoc providers?

If you need to display a unified view of both Zocdoc and non-Zocdoc providers, use the Zocdoc partner API to retrieve availability data for Zocdoc providers and your own database or API for other providers. V0 can generate the unified provider listing UI, and multiple Next.js API routes can aggregate data from different sources. This architecture requires partner API access from Zocdoc.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.