bash, curl, jq, an organization API key, and audience access.
Creating an active audience can use an audience slot or eligible one-shot access. This example writes files in a new local directory and leaves the audience in your organization. Review the preview before running the creation step.
Find topic IDs
SetLEADPIPE_API_KEY in your environment. Search for topics and select the returned IDs that match your use case:
ORBIT_TOPIC_IDS to a JSON array of your selected integer IDs. Use values returned by discovery, not IDs copied from an unrelated example. The following scripts share files in the working directory you create in the next step.
Validate and preview
Run in Bash:Create, run, and export
After reviewing the preview, run this in the same Bash session and directory. It stops immediately on request failures and polls only202 responses, for at most 60 attempts. The five-second interval and attempt limit are example client settings, not service timing guarantees.
401, 403, 409, or 429, this example stops instead of treating the error as pending. Read the response before retrying. For 429, honor Retry-After when present. A request timeout can leave a write’s outcome uncertain: inspect existing audiences or retry the run request with its saved idempotency key rather than restarting creation blindly.
results.json contains only the first page. Follow result pagination to read every row. Direct CSV exports are capped at 300,000 rows.