# Retrieve Traffic Data broken down by content type AND source

**URL:** <https://community.hubspot.com/t/retrieve-traffic-data-broken-down-by-content-type-and-source/123563>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [January 9, 2025, 9:01am UTC](https://community.hubspot.com/t/retrieve-traffic-data-broken-down-by-content-type-and-source/123563 "2025-01-09T09:01:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MLundy1](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@MLundy1](https://community.hubspot.com/u/MLundy1)\
**Post date:** [January 9, 2025, 9:01am UTC](https://community.hubspot.com/t/retrieve-traffic-data-broken-down-by-content-type-and-source/123563/1 "2025-01-09T09:01:22Z")

</div>

Request Details:  
Endpoint: [https://api.hubapi.com/analytics/v2/reports/totals/traffic](https://api.hubapi.com/analytics/v2/reports/totals/traffic)  
HTTP Method: GET  
Authorization: Bearer token (with proper scopes for analytics access)  
Headers:  
Content-Type: application/json  
Authorization: \<Bearer Token\>  
Token used in Bearer Token:  
Request Body:  
{  
“filters”: [  
{  
“property”: “contentType”,  
“operator”: “IN”,  
“value”: [“blog”, “landingPage”, “websitePage”]  
}  
],  
“breakdowns”: [  
“contentType”,  
“source”  
],  
“timeRange”: {  
“startDate”: “2023-12-01”,  
“endDate”: “2023-12-31”  
}  
}

Error:

- {

What I Am Trying to Achieve:  
I am attempting to:  
Retrieve traffic data for a date range  
Filter the data by content types: blog posts, landing pages, and website pages.  
Break down the results by content type and traffic source.  
I have reviewed the API documentation and tested the request in multiple ways (e.g., simplifying the payload, removing filters and breakdowns), but the issue persists.

i am storing the information in a data base so i could technically use a few differant calls to get the data i want but want the most simplified version possible. has anyone gotten this data in such a way or have ideas?

---

<div class="post-metadata">

**Author:** ![PMcConnell](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pmcconnell/32/82468_2.png) [@PMcConnell](https://community.hubspot.com/u/PMcConnell)\
**Post date:** [January 9, 2025, 11:44am UTC](https://community.hubspot.com/t/retrieve-traffic-data-broken-down-by-content-type-and-source/123563/2 "2025-01-09T11:44:32Z")

</div>

Hi @MLundy1  
I have had a quick look at this and it appears the endpoint is incorrect.  
Can you try something like this ?  
[https://api.hubapi.com/analytics/v2/reports/sources/total?start=20231201&end=20231231](https://api.hubapi.com/analytics/v2/reports/sources/total?start=20231201&end=20231231)  
I believe this should give you what you are looking for but if there any issues feel free to reach out.  
Also, I noticed you have included you private key in your post. I strongly recommend removing this from this post.  
Let me know if you need any more help.  
Pauric  
[p.mcconnell@baskey.eu](mailto:p.mcconnell@baskey.eu)  
[https://www.linkedin.com/in/pauric-mc-connell/](https://www.linkedin.com/in/pauric-mc-connell/)

---

<div class="post-metadata">

**Author:** ![MLundy1](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@MLundy1](https://community.hubspot.com/u/MLundy1)\
**Post date:** [January 9, 2025, 12:30pm UTC](https://community.hubspot.com/t/retrieve-traffic-data-broken-down-by-content-type-and-source/123563/3 "2025-01-09T12:30:02Z")

</div>

Hey,

Thanks for the response and the hint about the key forgot to remove it!

using the endpoint you suggest only returns the results broken down by source(organic,direct, etc) for ALL content types.

i would need it broken down by content type and then by source. i would like to report on for example standard pages that have direct traffic or other combinations.

do you have a suggestion for that?

---

<div class="post-metadata">

**Author:** ![PMcConnell](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pmcconnell/32/82468_2.png) [@PMcConnell](https://community.hubspot.com/u/PMcConnell)\
**Post date:** [January 13, 2025, 12:18pm UTC](https://community.hubspot.com/t/retrieve-traffic-data-broken-down-by-content-type-and-source/123563/4 "2025-01-13T12:18:10Z")

</div>

Hi @MLundy1 ,  
Sorry for my delay here but it seems like a tricky issue tbh. I can’t find a way to link the content type data back to the source data, as the source data does not contain content type or page id in the response.  
So I don’t think going through the api is the right direction.  
I have had a look through the Create Report option in the portal and you can create a report for each content type and map page views to Contact source. I know this may not be exactly what you are looking for but there doesn’t seem to be a way to map total views to the traffic source. But perhaps I am missing something so it could be worth exploring.
