Skip to main content
Follow these recommendations to get the most out of Xpoz’s API, whether you are building an AI agent, a data pipeline, or an interactive application.

Use field selection

Always specify the fields parameter to retrieve only the data you need. This dramatically improves response time and reduces memory usage.
For engagement analysis, use ["id", "text", "likeCount", "retweetCount", "replyCount", "createdAtDate"]. For user discovery, use ["id", "username", "name", "followersCount", "description"].

Choose the right response mode

Pagination patterns

Do not fetch all pages unless you actually need the full dataset. Common patterns:

Sample the first page, then decide

Jump to a specific page

Query optimization

Be specific with keywords

Use date ranges

Always include startDate (and optionally endDate) to limit results to a relevant time window:

Use platform-specific filters

Do not embed filters in the query string. Use dedicated parameters:

Error handling

Build retry logic for timeouts and transient failures:
Authentication errors (401) should never be retried. Timeout errors are safe to retry. Failed operations may indicate a server-side issue — check the operationError field for details.

Caching

Xpoz caches operation results server-side with a TTL:
  • Running operations: 30-minute TTL (auto-expire if stalled)
  • Completed operations: 15-minute TTL (retrieve results within this window)
  • Paginated tables: Remain available for page navigation after creation
For paging mode, the first call creates a server-side table with all results. Subsequent nextPage() and getPage(n) calls read from this cached table, making page navigation fast.

Client lifecycle

Always close the client when done to release resources:

Summary checklist

  • Always specify fields to reduce response size
  • Use Fast mode for quick lookups, Paging for iteration, CSV for bulk export
  • Include date ranges to narrow results
  • Use dedicated filter parameters instead of embedding filters in queries
  • Handle AuthenticationError and OperationTimeoutError separately
  • Close the client when done

Next steps

Query Syntax

Master boolean operators and phrase matching

CSV Exports

Export large datasets for offline analysis

Field Selection

Full list of available fields per platform

MCP Tools

Browse all 48 available tools