API Integration for Data Pipelines
REST APIs, authentication, pagination, rate limiting, and production ingestion patterns.
Most production data comes from APIs. The difference between a data engineer who *connects sources* and one who *runs the ingestion platform* is the difference between bespoke 23-connector chaos and a single plugin architecture every team can extend without breaking.
What you’ll be able to do
- Build REST + httpx ingestion connectors with OAuth refresh, idempotent retries, and dead-letter queues
- Orchestrate scheduled API ingestion in Airflow with watermarks, schema contracts, and freshness alerts
- Scale to dozens of connectors with a shared platform — unified auth, retry, observability, and cost
- Govern AI-agent API calls with function-calling schemas, semantic caching, and per-agent cost attribution
Curriculum
Phase 1: API Foundations
First API call, REST primitives, and authentication
Your First API Call
A 30-minute 'no theory' path: hit a public API with requests, parse JSON, write a row, run on a schedule. The minimal end-to-end loop every later module sharpens.
REST API Fundamentals
The retry-double-write trap, the 'missed last page' bug, and the 429-treated-as-500 fault — three real production patterns plus the requests-Session, status-code, and idempotency rules that prevent them.
Authentication & Authorization
OAuth 2.0 flows (auth code, client credentials), token refresh logic that survives 2:30 AM expirations, secrets management with environment variables / Vault / AWS Secrets Manager, and the 401-loop pattern to design around.
Phase 2: Production Ingestion
Orchestration, schema evolution, and scaling
Orchestration Patterns
Move ingestion from a laptop cron to a scheduled Airflow DAG with retries, idempotent UPSERTs, watermarks for incremental sync, and the operator-vs-task decisions that decide whether your Tuesday-morning script survives a vacation.
Schema Evolution & Errors
Pydantic models with extra='allow', schema versioning, the silent-validation-error pattern (Shopify added a required field, dropped every order), Great Expectations contracts, and dead-letter queues for un-parseable payloads.
Scaling & Observability
Parallel ingestion workers (asyncio + httpx, ThreadPoolExecutor), connection pooling, lag + freshness metrics, the silent-page-1-stop pattern, and the structured logs / OpenTelemetry traces that catch a green-task pipeline serving 18-hour-old data.
Phase 3: Strategy & Advanced
Reverse ETL, enterprise platform, AI agents, and capstone
Reverse ETL & Data Activation
Push warehouse data back into Salesforce / HubSpot / Slack with Hightouch / Census / custom workers, idempotent upserts on external IDs, sync-state tracking, and the activation patterns that close the loop from analytics → operational tools.
Enterprise Platform Architecture
When 23 connectors across 4 teams stop scaling: a shared API platform with unified auth, retry, schema, and observability primitives — config-driven connectors, plugin architecture, and the team-topology decisions that make it work.
API Integration for AI Agents
LLM agents that call external APIs without burning $40 K in unintended Salesforce calls — function-calling schemas, tool-use governance, semantic + result caching, rate-limit-aware retries, and the cost-attribution model per agent invocation.
API Integration Capstone
Architect a multi-source platform (Stripe + Shopify + Ads API) with three different auth models, three rate limits, three schema patterns — solved with a single shared core, not three bespoke connectors. The portfolio piece.
What you’ll build
- A REST ingestion library (Python + httpx + Pydantic) with token refresh, paginated fetch, idempotent retries, and DLQ — packaged as a reusable connector base
- An Airflow DAG that runs the connector hourly, watermarks state, validates schemas, and pages on freshness regressions
- A reverse-ETL job that pushes warehouse-enriched customer data back into Salesforce with idempotent upserts on external IDs
- A platform-architecture doc + reference connector showing config-driven auth / pagination / schema for 3 sources (Stripe + Shopify + Ads API), with cost + freshness dashboards
Without API integration discipline, your pipelines break at 2:30 AM and your AI agents burn $40 K in unintended calls.
WHAT GOES WRONG
- The 2:30 AM 401 loop — Salesforce access token expired, no refresh logic, every retry returns 401; pipeline silently stalls until morning standup
- The dropped-Shopify-orders incident — Shopify added a required field; the Pydantic model rejected every order created after the change; analytics show 'flat sales' for 3 days before anyone notices
- The 18-hour silent stop — Salesforce pipeline fetched page 1, got a valid response, quietly stopped; no exception, no alert, Airflow task green, VP of Sales discovers the dashboard is stale
- The $40 K AI-agent surprise — LLM agent calls the Salesforce API to fetch context per question; 200 user queries triggered 40,000 API calls and an unbudgeted $40 K bill before anyone saw the dashboard
What is API Integration for Data Pipelines?
API integration for data pipelines covers building reliable data ingestion from REST APIs, including authentication, pagination, rate limiting, and error recovery. Data engineers use these patterns to pull data from SaaS platforms, third-party services, and internal microservices into data warehouses and lakes.
Why this matters in production
Most production data comes from APIs — CRM, marketing, payment, and internal services. At companies like HubSpot, data teams ingest from dozens of APIs with different authentication, pagination, and rate limiting patterns. Robust API integration prevents the data gaps that break downstream analytics.
Common use cases
- Building data ingestion pipelines from SaaS APIs (Salesforce, HubSpot, Stripe)
- Handling pagination strategies across cursor, offset, and keyset APIs
- Implementing rate limiting and backoff strategies for API compliance
- Designing incremental sync patterns that minimize API calls and costs
- Setting up webhook receivers for real-time data ingestion
- Monitoring API integration health with alerting for failures and schema changes
API vs alternatives
API vs Fivetran/Airbyte
Custom API integration provides full control and handles unique APIs. Fivetran and Airbyte offer pre-built connectors for common APIs. Use managed connectors when available, custom integration for unique or complex APIs.
API vs Webhooks
API polling pulls data on a schedule. Webhooks push data in real-time. Webhooks have lower latency but require infrastructure. Most teams use webhooks where available and polling as fallback.
API vs Database CDC
API integration pulls data from service interfaces. CDC captures changes directly from databases. APIs are the standard for SaaS ingestion; CDC is preferred for databases you control.
Related skills
Why this skill matters
API integration is *the* most common data engineering task — and the one most likely to break in production at 2:30 AM. Mid-to-senior data engineers at HubSpot, Stripe, Segment, and every SaaS-heavy data org are paid for exactly this — turning brittle one-off scripts into a reusable platform that ingests dozens of sources without bespoke code per connector.
Common questions about API
What is API integration in data engineering?
API integration is building pipelines that pull data from REST APIs into warehouses and lakes. It includes authentication, pagination, error handling, and sync patterns specific to data ingestion.
Do data engineers need API skills?
Yes. API ingestion is one of the most common data engineering tasks. Understanding authentication, pagination, and rate limiting is essential for building reliable data pipelines.
How long does it take to learn API integration?
Basic API calls take a few days. Production integration with pagination, rate limiting, error recovery, and monitoring takes 3-4 weeks of practice.
Should I use Fivetran or build custom integrations?
Use managed connectors for standard APIs to save time. Build custom integrations for unique APIs, complex logic, or when you need full control over sync behavior and error handling.
What is incremental API sync?
Incremental sync only fetches new or changed records since the last sync, using timestamps or cursors. It reduces API calls, costs, and processing time compared to full-refresh syncs.