API for covert published blogs to json file and use for external website


#1

I am currently using hubspot to publish articles and blogs, then have my website points to this endpoint, but I want to host all my blog contents on my website instead for easy maintenance. Is there any API that can get all the blog content I published on hubspot into a json file for external use?


#2

@Nan_Shan you can get all of the posts from your HubSpot blog (or blogs if you have more than one) using the endpoint documented here:


#3

Thank you for your quick response dadams


#4

Looking at the API you suggested, seems like I need to have a API key to use (or at least test) this API, then get a Oauth implemented for standard secured access. I already created a dev account so I have API key, how do I link my new dev account to my marketing blogs. Also I am not sure if I need an hubspot app, I just need a public API with secured authentication to get me my marketing blog contents.

Thank you again,


#5

@Nan_Shan you’ll need to get the API key for the HubSpot account that you want to get the blog posts from, as that key is specific to each portal. You can find the API key for an account by following the instructions here:


#6

works like a charm :slight_smile: thank you dadams


#7

Hi dadams, thanks for all the helps and now I want to store this json file containing all my blog content to one of my aws s3 buckets and do the content pull whenever there is a new blog added. Is creating a hubspot app the right way to do it? Any suggestion will be much appreciated. BTW, if I no longer display my blogs on hubspot, does this mean I will lose my hubspot analytics capability as well? If so, is there any alternative to maintain the hubspot analytics on external site. Facebook/twitter or google does their analytics by insert an pixel and manage the browser behavior…


#8

@dadams, I am playing around with the blog post api yet I found out I only get 23 blogs object out of 95 total: {“total_count”: 95, “objects”: [{only 23 here}]} using: https://api.hubapi.com/content/api/v2/blog-posts?hapikey=myapikey, is there something I did wrong or how do I get all my blogs using this API?