Is it possible to get my Netlify Form data programmatically?

Is it possible to get my Netlify Form data programmatically?

For example, is there an API to call to pull the data down on a regular basis?

If not, then I may be able to use a post-submit webhook to submit to a database. Can you point me to any code examples for this? Is Zapier a common way to do this?

Thank you!

Hi, @MVO. Yes, the same API calls our web UI makes to display the form data can be used to download the form data programmatically.

The API endpoint might look like this (this is a real endpoint for one of my test sites):

https://api.netlify.com/api/v1/sites/5406a5b6-a640-4050-ac57-c44f14b98b93/forms/5ca57abc2af0b800083ef13b/submissions

The format is:

https://api.netlify.com/api/v1/sites/<SITE API ID>/forms/<FORM ID>/submissions

This also takes GET parameters to “page” the data and filter for spammed and approved submissions:

https://api.netlify.com/api/v1/sites/5406a5b6-a640-4050-ac57-c44f14b98b93/forms/5ca57abc2af0b800083ef13b/submissions?state=ham&page=1&per_page=20

If you want to learn more about our API, you can see the specification guide here:

https://open-api.netlify.com/

I always recommend using your developer tools to see how the Netlify web UI makes these API calls as they will show you exactly how to successful interact with the API. The open API guide is nice but nothing is better that seeing the real API in use.

If there are other questions about this, please let us know.

@luke That’s great news! I’m so grateful for your response. I will definitely check out the API docs. Thank you sir!

1 Like