API Query Library: Retrieving a List of Appointments for a Location via API

Modified on Wed, May 21 at 5:36 PM

If you’re looking to programmatically access appointments at a specific Vetspire location, this guide walks you through how to use GraphQL to retrieve that data using the Vetspire API.



When Would I Use This?



Use this query to:

  • Review all scheduled appointments for a location over a set period.

  • Audit patient and client engagement.

  • Export data for analysis or integration with other systems.


Sample GraphQL Query


Below is a sample query that pulls appointments for a specific location based on a time range of updates:

query appointments {
  appointments(
    locationId: "22657",
    updatedAtStart: "2022-05-12T00:00:00",
    updatedAtEnd: "2022-05-30T00:00:00"
  ) {
    schedule
    duration
    patient {
      name
      id
      client {
        name
        id
        email
      }
    }
    type {
      name
    }
  }
}

Parameter Breakdown

  • locationId: The unique identifier for the location (replace "22657" with your own location ID).

  • updatedAtStart / updatedAtEnd: The start and end of the date range for which to fetch updated appointment records.

  • schedule: The scheduled time of the appointment.

  • duration: The appointment duration in minutes.

  • patient: Information about the pet.

  • client: Information about the pet parent (owner), including name and email.

  • type: The type of appointment (e.g., wellness exam, follow-up).



Pro Tips


  • Always double-check that the locationId matches the intended hospital.

  • If your query returns no results, verify that appointments were updated in the date range provided—not just created.

  • You can adjust this query to include other fields such as appointment status, provider, or notes depending on your use case.



 Still Need Help?



If you’re unsure how to locate your locationId, or you’d like help modifying the query for a specific use case, reach out to Vetspire Support via the chat bubble or submit a ticket.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

https://support.vetspire.com/a/admin/portals/70000004548/themes