Instagram has become the go-to platform for millions of users to share their experiences and interests. Under the surface of captivating visuals and engaging stories lies valuable data. However, the user engagement data is not in an analysis-ready format, emphasizing the importance of moving your data to data warehouses like BigQuery for simplifying analytics tasks.  

By consolidating your Instagram data in BigQuery, you can unlock valuable opportunities — from better understanding your audience and trends to refining content strategies.

This guide will walk you through the step-by-step process of loading your Instagram data into BigQuery. Before we jump into the tutorial, let’s first understand the two systems. 

Instagram Overview

Blog Post Image

Image Source

Instagram, a social media platform that launched in 2010, has gained immense popularity for its visually appealing and user-friendly interface. This platform empowers users to share a variety of content, including photos, videos, and stories, with their followers. Instagram’s main feed curates and displays your posts alongside those from other users, fostering a dynamic environment where you can like, comment on, and engage with a diverse array of posts. 

In addition to offering personal accounts, Instagram also provides a business account option. A business account provides access to comprehensive insights, including audience demographics, engagement metrics, reach, and the performance of posts and stories. This data is invaluable for refining marketing strategies, gaining a deeper understanding of your audience, and customizing your content to align with your brand’s objectives. 

BigQuery Overview

Blog Post Image

Image Source

Developed by Google, BigQuery is a robust cloud-based data warehousing and analytics platform. With BigQuery, you can efficiently store, manage, and analyze vast amounts of structured and semi-structured data. To expedite the analytics processes, BigQuery supports columnar storage and parallel processing. While columnar storage assists in quickly scanning the required data, parallel processing helps with the distributed computation of big data. It automatically scales to handle varying workloads, ensuring you can analyze data of any size without worrying about resource limitations.

BigQuery is not limited to descriptive and diagnostic analytics. You can also use its built-in artificial intelligence and machine learning capabilities to gain deeper insights into your data. This versatility is enhanced by the ability to use SQL in BigQuery for creating machine-learning models, offering more advanced data analysis.  

Two Methods to Move Data from Instagram to BigQuery

  • Method 1: Manually Migrate Data from Instagram to BigQuery
  • Method 2: Using SaaS Tools like Estuary Flow 

Method 1: Manually Migrate Data from Instagram to BigQuery

In this method, you’ll be using the Instagram Graph API to retrieve data from your Instagram account. The Instagram Graph API is an interface provided by Facebook that allows you to programmatically access and interact with data on Instagram. You can use this API to fetch various types of data from Instagram, including user data, media (photos and videos), comments, likes, insights, hashtags, locations, and mentions. The API enables you to fetch data from both creator and business accounts.


  • Facebook Developer Account: Create a new Facebook developer account or use an existing one.
  • Instagram Account: Log in to your Instagram business account and connect it to a Facebook page to access the Instagram Graph API.
  • API Access: Generate the Instagram Graph API access token with the required permissions to access the data you need.
  • Google Cloud Account: Sign in or create a new Google Cloud account to utilize BigQuery. Then create a new project. 

Step 1: Set up the Instagram App

  • Log in to your Facebook developer account and create a new Instagram app within the developer account. Make a note of the client ID and client Secret.
  • Use OAuth to generate an access token with the necessary permissions. It serves as an authentication token for your API requests.

Step 2: Retrieve Instagram Data

  • Determine the appropriate Instagram Graph API endpoint for the data you want to retrieve. Next, use a programming language like Python or JavaScript to make API requests. Include the access token from the previous step in the headers of your API request.
  • The response from the API will be in JSON format. Parse this response to access the retrieved data.

For instance, if you’re using Python’s request library to fetch user data, your code would look like:

import requests access_token = "YOUR_ACCESS_TOKEN" endpoint = "{user-id}/userdata” headers = { “Authorization": “{access token}” } response = requests.get(endpoint, headers=headers) data = response.json()

The data variable in the above example holds the JSON response from the Instagram API, which includes specified userdata.

  • Depending upon your requirements, you can fetch relevant details.
  • Transform the data, if needed, to make it compatible with the BigQuery schema being used.

Step 3: Create a BigQuery Dataset and Table

  • Log in to your Google Cloud Console. Create a new dataset within your BigQuery project to store the Instagram data. You can follow this guide to create a new dataset in the BigQuery project.
  • Navigate to the dataset that you’ve just created, then click on Create table to create a new BigQuery table. In the Create table form, provide a table ID and Name.

Step 4: Load Data into BigQuery

You can load data into BigQuery using the BigQuery console, bq command, or BigQuery API. In this section, we will cover uploading data in BigQuery using the console.

  • Go to the table you created in Step 3. Select the Upload method to manually upload data from a file.
  • Click on the Select file button and choose the JSON files you want to upload.
  • Choose the file format as JSON.
  • In the Schema section, specify whether you want BigQuery to automatically detect the schema from the data or if you’ll provide schema definition separately. If you choose to define the schema for your table, ensure it matches the structure of your JSON data files. For each column, specify the name, data type, and any additional attributes. You can also define nested structures using the Add nested field option.
  • Click on the Start Upload button. This will start migrating your JSON files to the BigQuery table.

These steps complete your Instagram to BigQuery data migration process.

Limitations of the Manual Method

While the manual approach is straightforward for specific scenarios like occasional backups or transfers, it comes with certain limitations: 

  • Human Errors: Manual data transfers are susceptible to human errors during data preparation, transformation, and loading. This can lead to inconsistencies, inaccuracies, and incorrect data uploads.
  • Programming Experience: The manual method involves writing custom scripts to extract data from Instagram to BigQuery. This requires a strong understanding of programming languages, APIs, data formats, and data manipulation techniques.

Here’s an alternative!

Method 2: Using SaaS Tools like Estuary Flow

SaaS solutions provide pre-built connectors to simplify the data replication process, reducing the need for complex coding or manual data manipulation.

Estuary Flow is a low-code real-time change data capture and streaming ETL SaaS platform that is designed to streamline the data integration process, enabling faster setup and deployment. This is useful when there’s a need for time-sensitive data replication. With a cloud-native architecture, Flow guarantees both scalability and optimal performance. 

Here are some features of Estuary Flow:

  • Many to many ETL: Estuary Flow supports many-to-many real-time or batch ETL, with multiple sources and targets in the same pipeline, and streaming transformations. It also supports E(T)LT mode, including dbt support.
  • Connectors: With a wide support of pre-built source and destination connectors, Estuary provides robust solutions for various data integration requirements. Its sources and destination connectors cover popular data warehouses, SaaS applications, databases, and APIs.
  • Scalability: It can handle massive datasets with a capacity of up to 7GB/s and 10TB+ tables. This enables seamless data transfer for operations from small data sets to enormous at terabyte-scale.
  • Exactly-once Semantics: Estuary is built on Gazette, similar to Kafka, offering exactly-once processing semantics. This eliminates the necessity of de-duplicating real-time data.
  • CDC: It uses CDC (Change Data Capture) to capture and deliver data changes in real-time. This allows you to have up-to-date and synchronized data across the system. CDC technique is especially valuable for applications that require real-time analytics, reporting, or synchronization between different data sources.
  • Automatic Schema Handling: As an automated service, Flow takes care of data mapping and schema handling. It infers into the schema source changes and automatically maps them to the destination, allowing you to focus on other critical tasks.

Here is the step-by-step guide for connecting Instagram to BigQuery using Estuary Flow:


Before you connect Instagram to Google BigQuery, complete these requirements:

Step1: Log in or Register

  • Log in to your Estuary account if you already have one, or sign up for free.

Step 2: Establish and Setup Instagram as a Data Source

  • After successful login, you’ll be directed to the Estuary dashboard. Select Sources, located on the left side of the Estuary dashboard, to begin setting up your data pipeline.
Blog Post Image

Image Source

  • You’ll be navigated to the Sources page. Click the + NEW CAPTURE button.
Blog Post Image

Image Source

  • On the Create Capture page, use the Search connectors box to find Instagram from the available connectors. Click the Capture button to continue.
Blog Post Image

Image Source

  • On the Instagram Create Capture page, fill in the required fields, including the connector Name and Start Date for data replication. Then, authenticate your Instagram account.
Blog Post Image

Image Source

  • Once all the required fields are filled, click NEXT, followed by SAVE AND PUBLISH.

Step 3: Establish and Setup BigQuery as Destination

  • Now that you’ve configured BigQuery as your destination, navigate to Estuary’s dashboard and select Destinations from the left-side pane.
  • On the Destinations page, click + NEW MATERIALIZATION.
Blog Post Image

Image Source

  • You’ll be directed to the Create Materialization page. Enter BigQuery in the Search connector box and click the Materialization button to continue.
Blog Post Image

Image Source

  • On the BigQuery Create Materialization page, provide a unique connector Name. Fill in the required Endpoint Config fields, such as Project ID, Region, Dataset, and Bucket details. 
  • If the data captured from Instagram wasn’t filled in automatically, you can add the data from the Source Collection section.
Blog Post Image

Image Source

  • After filling in all the details, click NEXT and then SAVE AND PUBLISH. Estuary Flow will now continuously replicate your Instagram data in the BigQuery data warehouse in real-time.

For more detailed instructions, refer to the Estuary Flow documentation:


Connecting the Instagram Graph API to Google BigQuery is an effective way to harness social media insights for data-driven decision-making. Methods for connecting Instagram to Google BigQuery include using the Instagram Graph API and SaaS alternatives like Estuary Flow. While the manual approach offers control and customization, it comes with limitations such as time-consuming processes and potential data latency.

On the other hand, Estuary Flow streamlines the entire data integration process. You can automate the data replication process with just three steps without extensive coding. By opting for automation, you can sidestep the challenges of manual integration, significantly reduce the margin for errors, and harness the power of Instagram data within BigQuery in real-time.

Replicate your Instagram data into BigQuery with Estuary’s real-time synchronization—build your first pipeline today!

Interested in integrating other data sources with BigQuery?  Check out these insightful guides:

Start streaming your data for free

Build a Pipeline