DEV Community

Alex Spinov
Alex Spinov

Posted on

Tinybird Has a Free API That Turns Raw Data Into Real-Time Analytics Endpoints

Tinybird lets you ingest millions of rows, write SQL, and publish the results as blazing-fast API endpoints. Real-time analytics as a service.

What Is Tinybird?

Tinybird is a real-time analytics platform built on ClickHouse. Ingest data, query it with SQL, and expose the results as API endpoints — in minutes.

How It Works

1. Ingest Data

export TB_TOKEN="your-token"

# Send events via API
curl -s -X POST 'https://api.tinybird.co/v0/events?name=page_views' \
  -H "Authorization: Bearer $TB_TOKEN" \
  -d '{"timestamp": "2026-03-30T10:00:00Z", "page": "/pricing", "country": "US", "device": "mobile"}'

# Bulk ingest (NDJSON)
curl -s -X POST 'https://api.tinybird.co/v0/events?name=page_views' \
  -H "Authorization: Bearer $TB_TOKEN" \
  --data-binary @events.ndjson
Enter fullscreen mode Exit fullscreen mode

2. Write SQL Pipe

-- top_pages.pipe
SELECT
  page,
  count() as views,
  uniq(session_id) as unique_visitors,
  avg(duration) as avg_duration
FROM page_views
WHERE timestamp >= now() - interval 24 hour
GROUP BY page
ORDER BY views DESC
LIMIT 20
Enter fullscreen mode Exit fullscreen mode

3. Publish as API

# Your SQL is now a REST endpoint!
curl -s 'https://api.tinybird.co/v0/pipes/top_pages.json?token=READ_TOKEN'

# With parameters
curl -s 'https://api.tinybird.co/v0/pipes/top_pages.json?token=READ_TOKEN&date_from=2026-03-29&country=US'
Enter fullscreen mode Exit fullscreen mode

Dynamic Parameters

-- revenue_by_day.pipe
%
SELECT
  toDate(timestamp) as date,
  sum(amount) as revenue,
  count() as transactions
FROM orders
WHERE 1=1
  {% if defined(date_from) %} AND timestamp >= {{DateTime(date_from)}} {% end %}
  {% if defined(country) %} AND country = {{String(country)}} {% end %}
GROUP BY date
ORDER BY date DESC
Enter fullscreen mode Exit fullscreen mode
# Dynamic filtering via query params
curl -s 'https://api.tinybird.co/v0/pipes/revenue_by_day.json?token=READ_TOKEN&date_from=2026-03-01&country=DE'
Enter fullscreen mode Exit fullscreen mode

JavaScript SDK

// Use the API endpoint in your frontend
const response = await fetch(
  'https://api.tinybird.co/v0/pipes/top_pages.json?token=READ_TOKEN&date_from=2026-03-29'
)
const { data } = await response.json()

// data = [{ page: '/pricing', views: 1234, unique_visitors: 890 }, ...]
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • Product analytics: page views, feature usage, funnels
  • Real-time dashboards: live metrics for ops teams
  • API analytics: endpoint latency, error rates, usage per customer
  • E-commerce: real-time revenue, inventory, popular products
  • IoT: sensor data aggregation and alerting

Free Tier

Feature Free Pro
Data 10 GB 100 GB
API requests 1K/day 100K/day
Rows ingested 1M/day 10M/day
Pipes 5 Unlimited
Query latency Sub-second Sub-second

Tinybird vs Alternatives

Feature Tinybird BigQuery Supabase
Real-time ingest Yes Near-real-time Yes
SQL to API Built-in Needs wrapper Needs wrapper
Latency <100ms 1-10s 100-500ms
Streaming Yes Limited No

Need to analyze scraped data in real-time? Scrapfly + Tinybird = instant analytics on web data. Email spinov001@gmail.com for custom data pipelines.

Top comments (0)