# Get form submissions by source

**URL:** <https://community.hubspot.com/t/get-form-submissions-by-source/115304>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [August 27, 2024, 4:06pm UTC](https://community.hubspot.com/t/get-form-submissions-by-source/115304 "2024-08-27T16:06:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArnaudStephan](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ArnaudStephan](https://community.hubspot.com/u/ArnaudStephan)\
**Post date:** [August 27, 2024, 4:06pm UTC](https://community.hubspot.com/t/get-form-submissions-by-source/115304/1 "2024-08-27T16:06:00Z")

</div>

Hello,  
I’m currently using this endpoint to get data on our forms :

[https://api.hubapi.com/analytics/v2/reports/forms/weekly?&start={start\_date}&end={end\_date}&f={formId}](https://api.hubapi.com/analytics/v2/reports/forms/weekly?&start=%7Bstart%5C_date%7D&end=%7Bend%5C_date%7D&f=%7BformId%7D)

This allows me to get weekly analytics for all of our forms, but it is not grouped by source, like you can see in Hubspot directly :

 ![Screenshot 2024-08-27 at 17.48.43.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/7/f747ef4991e0ea2ccf684590199650d2fc695c34.png)

Is there a way to get this data from an endpoint ? The [v3 API documentation](https://developers.hubspot.com/docs/api/marketing/forms) does not seem to include the possibility, and I did not manage to find the correct way of doing it using the [analytics v2 API](https://legacydocs.hubspot.com/docs/methods/analytics/get-analytics-data-breakdowns).  
I’ve tried a lot of different approaches while trying to build the correct URL to make the request to, but I’ve only been able to get analytics data grouped by form, and not form + source.

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [August 28, 2024, 11:46am UTC](https://community.hubspot.com/t/get-form-submissions-by-source/115304/2 "2024-08-28T11:46:19Z")

</div>

Hi @ArnaudStephan

HubSpot’s v2 Analytics API does provide some data on form submissions and other analytics. Still, its functionality is limited when it comes to breaking down analytics by specific sources (e.g., traffic source, original source, etc.) within the same API call.

As of now, HubSpot’s API documentation does not offer a straightforward way to directly fetch form analytics data grouped by source, as you see in the HubSpot dashboard.  
**Step 1:** Get Form Submissions. Use the Forms API to retrieve submissions for a specific form.

**Step 2:** Fetch Contact Source Information For each contact from the list, use the Contacts API to get source information.

**Step 3:** Group Data by Source. Use your server-side language (Node.js, Python, etc.) to group this data by hs\_analytics\_source or any other relevant property.

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!

---

<div class="post-metadata">

**Author:** ![ArnaudStephan](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@ArnaudStephan](https://community.hubspot.com/u/ArnaudStephan)\
**Post date:** [August 28, 2024, 11:54am UTC](https://community.hubspot.com/t/get-form-submissions-by-source/115304/3 "2024-08-28T11:54:00Z")

</div>

Hey Gaurav !  
The problem with this solution is that it will only work with submissions, but not views. I guess I’ll have to wait for a better version of the API to be able to do that 😉

Thanks anyway !
