

Building your pipeline or Using Airbyte
Airbyte is the only open source solution empowering data teams to meet all their growing custom business demands in the new AI era.
- Inconsistent and inaccurate data
- Laborious and expensive
- Brittle and inflexible
- Reliable and accurate
- Extensible and scalable for all your needs
- Deployed and governed your way
Start syncing with Airbyte in 3 easy steps within 10 minutes



Take a virtual tour
Demo video of Airbyte Cloud
Demo video of AI Connector Builder
What sets Airbyte Apart
Modern GenAI Workflows
Move Large Volumes, Fast
An Extensible Open-Source Standard
Full Control & Security
Fully Featured & Integrated
Enterprise Support with SLAs
What our users say


"The intake layer of Datadog’s self-serve analytics platform is largely built on Airbyte.Airbyte’s ease of use and extensibility allowed any team in the company to push their data into the platform - without assistance from the data team!"


“Airbyte helped us accelerate our progress by years, compared to our competitors. We don’t need to worry about connectors and focus on creating value for our users instead of building infrastructure. That’s priceless. The time and energy saved allows us to disrupt and grow faster.”


“We chose Airbyte for its ease of use, its pricing scalability and its absence of vendor lock-in. Having a lean team makes them our top criteria. The value of being able to scale and execute at a high level by maximizing resources is immense”
Prerequisites:
- A Mailgun account with API access
- A Google account with access to Google Sheets
- Basic knowledge of programming (preferably in Python for this guide)
- Google Cloud Project with the Sheets API enabled
- OAuth 2.0 setup for the Google Sheets API
- Install Python on your system if it’s not already installed.
- Install necessary Python libraries using pip:
pip install requests google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client
- Log in to your Mailgun account.
- Navigate to the API Security settings and note down your API key and the base URL for your Mailgun API.
- Go to the Google Developers Console (https://console.developers.google.com/).
- Create a new project or select an existing one.
- Go to “API & Services” > “Credentials”.
- Configure the OAuth consent screen.
- Create credentials > OAuth client ID > select “Desktop app” as the application type.
- Download the JSON file with your credentials and save it as credentials.json in your working directory.
- Create a Python file (e.g., mailgun_to_sheets.py) and import the necessary modules:
import requests
import json - Write a function to fetch data from Mailgun:
def fetch_mailgun_data(api_key, domain):
url = f"https://api.mailgun.net/v3/{domain}/events"
auth = ("api", api_key)
response = requests.get(url, auth=auth)
if response.status_code == 200:
return response.json()
else:
raise Exception("Failed to fetch data from Mailgun")
- Continue in the same Python file and import Google Sheets API modules:
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from googleapiclient.discovery import build - Write a function to authenticate and get access to Google Sheets:
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
def google_sheets_auth():
creds = None
if os.path.exists('token.json'):
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
with open('token.json', 'w') as token:
token.write(creds.to_json())
return creds - Write a function to insert data into Google Sheets:
def insert_data_to_sheets(creds, spreadsheet_id, range_name, data):
service = build('sheets', 'v4', credentials=creds)
sheet = service.spreadsheets()
body = {
'values': data
}
result = sheet.values().append(spreadsheetId=spreadsheet_id, range=range_name,
valueInputOption='USER_ENTERED', body=body).execute()
print(f"{result.get('updates').get('updatedCells')} cells appended.")
- In the same Python file, combine the above functions to fetch data from Mailgun and insert it into Google Sheets:
def main():
# Mailgun credentials
api_key = 'your_mailgun_api_key'
domain = 'your_mailgun_domain'
# Fetch data from Mailgun
mailgun_data = fetch_mailgun_data(api_key, domain)
# Format the data as needed for Google Sheets
formatted_data = [[entry['id'], entry['event'], entry['timestamp']] for entry in mailgun_data['items']]
# Authenticate with Google
creds = google_sheets_auth()
# Google Sheets details
spreadsheet_id = 'your_spreadsheet_id'
range_name = 'Sheet1' # Or any other sheet and cell range where you want to insert data
# Insert data into Google Sheets
insert_data_to_sheets(creds, spreadsheet_id, range_name, formatted_data)
if __name__ == '__main__':
main() - Replace 'your_mailgun_api_key', 'your_mailgun_domain', and 'your_spreadsheet_id' with your actual Mailgun API key, domain, and Google Sheets spreadsheet ID.
- Run the script:
python mailgun_to_sheets.py
This script will prompt you to authenticate with Google the first time you run it, and it will store the credentials for future use. Once authenticated, it will fetch the data from Mailgun and append it to the specified Google Sheet.
FAQs
What is ETL?
ETL, an acronym for Extract, Transform, Load, is a vital data integration process. It involves extracting data from diverse sources, transforming it into a usable format, and loading it into a database, data warehouse or data lake. This process enables meaningful data analysis, enhancing business intelligence.
Mailgun is a well-known provider of email API services you can easily use to send, validate, and receive emails through your domain at scale. Mailgun also assists you to track the performance of your sent emails with robust open, click, bounce, and delivery tracking. It has remaining an email validation service, powered by its email-sending cache, that provides some of the most accurate validation results on the market. You can easily create personalized emails targeted at a specific audience.
Mailgun's API provides access to various types of data related to email delivery and management. The following are the categories of data that can be accessed through Mailgun's API:
1. Email sending and delivery data: - Information about sent emails, including sender and recipient email addresses, subject, and content. - Delivery status of emails, including whether they were successfully delivered or bounced.
2. Email tracking data: - Open and click tracking data, which provides information about when and how many times an email was opened or clicked. - Unsubscribe tracking data, which provides information about when and how many times a recipient unsubscribed from an email list.
3. Email validation data: - Information about the validity of email addresses, including whether they are formatted correctly and whether they exist.
4. Account and domain management data: - Information about the account and domain settings, including API keys, domains, and webhooks. - Usage statistics, including the number of emails sent and received, and the amount of storage used. Overall, Mailgun's API provides a comprehensive set of data that can be used to monitor and optimize email delivery and management.
What is ELT?
ELT, standing for Extract, Load, Transform, is a modern take on the traditional ETL data integration process. In ELT, data is first extracted from various sources, loaded directly into a data warehouse, and then transformed. This approach enhances data processing speed, analytical flexibility and autonomy.
Difference between ETL and ELT?
ETL and ELT are critical data integration strategies with key differences. ETL (Extract, Transform, Load) transforms data before loading, ideal for structured data. In contrast, ELT (Extract, Load, Transform) loads data before transformation, perfect for processing large, diverse data sets in modern data warehouses. ELT is becoming the new standard as it offers a lot more flexibility and autonomy to data analysts.
What should you do next?
Hope you enjoyed the reading. Here are the 3 ways we can help you in your data journey: