|
| 1 | +--- |
| 2 | +title: Tinybird |
| 3 | +description: Send events and query data with Tinybird |
| 4 | +--- |
| 5 | + |
| 6 | +import { BlockInfoCard } from "@/components/ui/block-info-card" |
| 7 | + |
| 8 | +<BlockInfoCard |
| 9 | + type="tinybird" |
| 10 | + color="#2EF598" |
| 11 | +/> |
| 12 | + |
| 13 | +## Usage Instructions |
| 14 | + |
| 15 | +Interact with Tinybird using the Events API to stream JSON or NDJSON events, or use the Query API to execute SQL queries against Pipes and Data Sources. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## Tools |
| 20 | + |
| 21 | +### `tinybird_events` |
| 22 | + |
| 23 | +Send events to a Tinybird Data Source using the Events API. Supports JSON and NDJSON formats with optional gzip compression. |
| 24 | + |
| 25 | +#### Input |
| 26 | + |
| 27 | +| Parameter | Type | Required | Description | |
| 28 | +| --------- | ---- | -------- | ----------- | |
| 29 | +| `base_url` | string | Yes | Tinybird API base URL \(e.g., https://api.tinybird.co or https://api.us-east.tinybird.co\) | |
| 30 | +| `datasource` | string | Yes | Name of the Tinybird Data Source to send events to | |
| 31 | +| `data` | string | Yes | Data to send as NDJSON \(newline-delimited JSON\) or JSON string. Each event should be a valid JSON object. | |
| 32 | +| `wait` | boolean | No | Wait for database acknowledgment before responding. Enables safer retries but introduces latency. Defaults to false. | |
| 33 | +| `format` | string | No | Format of the events data: "ndjson" \(default\) or "json" | |
| 34 | +| `compression` | string | No | Compression format: "none" \(default\) or "gzip" | |
| 35 | +| `token` | string | Yes | Tinybird API Token with DATASOURCE:APPEND or DATASOURCE:CREATE scope | |
| 36 | + |
| 37 | +#### Output |
| 38 | + |
| 39 | +| Parameter | Type | Description | |
| 40 | +| --------- | ---- | ----------- | |
| 41 | +| `successful_rows` | number | Number of rows successfully ingested | |
| 42 | +| `quarantined_rows` | number | Number of rows quarantined \(failed validation\) | |
| 43 | + |
| 44 | +### `tinybird_query` |
| 45 | + |
| 46 | +Execute SQL queries against Tinybird Pipes and Data Sources using the Query API. |
| 47 | + |
| 48 | +#### Input |
| 49 | + |
| 50 | +| Parameter | Type | Required | Description | |
| 51 | +| --------- | ---- | -------- | ----------- | |
| 52 | +| `base_url` | string | Yes | Tinybird API base URL \(e.g., https://api.tinybird.co\) | |
| 53 | +| `query` | string | Yes | SQL query to execute. Specify your desired output format \(e.g., FORMAT JSON, FORMAT CSV, FORMAT TSV\). JSON format provides structured data, while other formats return raw text. | |
| 54 | +| `pipeline` | string | No | Optional pipe name. When provided, enables SELECT * FROM _ syntax | |
| 55 | +| `token` | string | Yes | Tinybird API Token with PIPE:READ scope | |
| 56 | + |
| 57 | +#### Output |
| 58 | + |
| 59 | +| Parameter | Type | Description | |
| 60 | +| --------- | ---- | ----------- | |
| 61 | +| `data` | json | Query result data. For FORMAT JSON: array of objects. For other formats \(CSV, TSV, etc.\): raw text string. | |
| 62 | +| `rows` | number | Number of rows returned \(only available with FORMAT JSON\) | |
| 63 | +| `statistics` | json | Query execution statistics - elapsed time, rows read, bytes read \(only available with FORMAT JSON\) | |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +## Notes |
| 68 | + |
| 69 | +- Category: `tools` |
| 70 | +- Type: `tinybird` |
0 commit comments