Airbyte API Client

0.53.0 · active · verified Thu Apr 09

The `airbyte-api` library is the official Python client SDK for interacting with the Airbyte API. It provides programmatic access to manage connections, sources, destinations, and perform data synchronization operations. The current version is 0.53.0 and it is actively maintained with frequent updates reflecting the underlying Airbyte platform and API.

Warnings

Install

Imports

Quickstart

Initialize the Airbyte client with API key and server URL, then perform a simple API call to list workspaces. Remember to set `AIRBYTE_API_KEY` and `AIRBYTE_SERVER_URL` environment variables, or replace placeholders.

import airbyte_api
import os
from airbyte_api.models import shared

# Initialize the Airbyte client
client = airbyte_api.Airbyte(
    bearer_auth=os.environ.get('AIRBYTE_API_KEY', 'YOUR_API_KEY'),
    server_url=os.environ.get('AIRBYTE_SERVER_URL', 'https://api.airbyte.com/v1')
)

# Example: List workspaces
try:
    response = client.workspaces.list_workspaces()

    if response.status_code == 200:
        print("Successfully listed workspaces:")
        for workspace in response.list_workspaces_response.data:
            print(f"- ID: {workspace.workspace_id}, Name: {workspace.name}")
    else:
        print(f"Error listing workspaces: Status {response.status_code}")
        if response.error_response:
            print(f"Error details: {response.error_response.message}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

view raw JSON →