How to programmatically export your Gatsby data
This is ideal for developers and brands who have custom integration needs or want to streamline their export / import process into any on-prem systems.
To programmatically export your Gatsby data, please follow the steps below.
Step 1: Create your Gatsby API Key
-
Log into Gatsby >> Hover over top right menu >> Integrations >> scroll to the bottom and click "Create Private API Key"
Step 2: Call the API
Starting in April 2024, you can now call your media and people separately:
API Type: GET
API URL: https://gatsby.tech/v2/export/media?
Request header:{
"apikey" : "string", // required
}
Request query parameters:
{
"capture_date" : "MM-DD-YYYY" // optional
"capture_end_date" : "MM-DD-YYYY" // optional
"mention_date" : "MM-DD-YYYY" // optional
"mention_end_date" : "MM-DD-YYYY" // optional
"order" : "asc or desc" // optional
"sort_by_column" : 'like','tiktokHandle','engagement','publishDate','handle','followers','addedDate','mentionDate' //Optional from any of these
"page" : "1" // optional
"limit" : "20" // optional
}
---------------------------------------------------------------------
API Type: GET
API URL: https://gatsby.tech/v2/export/people?
Request header:{
"apikey" : "string", // required
}
Request query parameters:
{
"capture_date" : "MM-DD-YYYY" // optional
"capture_end_date" : "MM-DD-YYYY" // optional
"mention_date" : "MM-DD-YYYY" // optional
"mention_end_date" : "MM-DD-YYYY" // optional
"order" : "asc or desc" // optional
"sort_by_column" : 'addedDate','mentionDate','captureDate','igHandle','tiktokHandle','email','igFollower','followYou','igFollows','tiktokFollower','tiktokHearts','gscore','bio','post','tiktokFollows','tiktokVideos','tiktokBio,'source' //Optional from any of these
"page" : "1" // optional
"limit" : "20" // optional
}
Note:
When a call is made to the /v2/export/media endpoint without any query string parameters all media for the brand associated with the API key will be returned.
When a call is made to the /v2/export/people endpoint without any query string parameters all profiles for the brand associated with the API key will be returned.
Step 3: Parse JSON Response
- The response will include all people and media data from your Gatsby account.
- If you used "capture_date" or "mention_date" and "mention_end_date" in your request, then the response will include specifically your data on the people associated with handles that were captured after that date.
- For example: If you call the API with a capture date of 1-1-2021, then the JSON response will include all people and all media associated with users who were captured after 1-1-2021. Time zone GMT.
Example Response:
{
"mediaData": [
{
"mediaUrl": "https://dev-gatsby.s3-us-west-1.amazonaws.com/instagramUserImages/test.jpg",
"type": "IG Post",
"caption": 'Who is looking for more power? #Cycle #pelotoncycle #Socks4balance Gatsby: Smarter Instagram Management ",
"influencerMentionedYouAccount": "test",
"like": 0,
"comment": 0,
"engagement": "0.3%",
"handle": "abc",
"followers": 19,
"addedDate": "2023-03-28T06:11:47.728Z",
"publishDate": "2023-03-28T06:11:47.728Z",
"mentionDate": "2023-03-28T06:11:49.420Z",
"handleVerified": false
},
}
-----------------------------------------------------------------------------
{
"peopleData": [
{
"igUserImg": "https://dev-gatsby.s3-us-west-1.amazonaws.com/instagramUserImages/test.jpg",
"ttUserImg": "https://scontent-sjc3-1.cdninstagram.com/v/t51.2885-15/75616356_481158675942187_483889121969631076_n.jpg?_nc_cat=105&ccb=2&_nc_sid=8ae9d6&_nc_ohc=WCd7txfXkYUAX9eUEOq&_nc_ht=scontent-sjc3-1.cdninstagram.com&oh=01a27feddc268cee049f96aa381ae017&oe=6031C92E",
"igHandle": "test",
"tiktokHandle": "abc",
"email": "abc@gmail.com",
"igFollower": "5",
"followYou": false,
"igFollows": "15",
"tiktokFollower": 465,
"tiktokHearts": 0,
"igMentionCount": 1,
"igLastMention": "2024-03-26T08:11:08.904Z",
"tiktokMentionCount": 0,
"tiktokLastMention": null,
"addedDate": "2024-03-26T12:01:52.103Z",
"gscore": "D",
"bio": "",
"post": "259",
"tiktokFollows": 38,
"tiktokVideos": 0,
"tiktokBio": "N/A",
"tags": "",
"handleVerified": false,
"source": "Form / Webhook",
"captureDate": "03-26-2024",
"mentionDate": "07-08-2021, 07-06-2021, 07-06-2021, 05-21-2021, 07-06-2021, 05-27-2021, 07-06-2021, 05-21-2021, 04-19-2021, 04-19-2021, 04-16-2021, 04-19-2021, 04-19-2021, 11-24-2021, 11-18-2021, 11-22-2021, 11-19-2021, 11-22-2021, 11-19-2021, 11-22-2021, 11-19-2021, 11-24-2021, 11-22-2021, 11-22-2021, 11-25-2021, 11-24-2021, 11-25-2021, 11-19-2021, 08-19-2021, 07-27-2021, 07-16-2021, 07-16-2021, 03-26-2024"
}
Example of media data call and response:
Example of people data call and response:
That's it! If you have any questions, please don't hesitate to open a support ticket with us and we'll get back to you as quickly as possible. Thanks!