Skip to main content
This guide covers the key concepts you need to integrate the Search Posts endpoints into your application.

Authentication

Recent search supports multiple authentication methods: Full-archive search only supports OAuth 2.0 App-Only authentication.
Private metrics (non_public_metrics, organic_metrics, promoted_metrics) are not available with full-archive search because it only supports App-Only authentication.

Building queries

Queries use operators to match Posts. Combine operators with boolean logic:

Query length limits

Operator types

Build a query

Learn query syntax in detail

Operator reference

See all available operators

Fields and expansions

By default, the response includes only id, text, and edit_history_tweet_ids. Use parameters to request additional data.

Example request

cURL

Available expansions

Fields and expansions guide

Learn more about customizing responses

Pagination

Search endpoints return results in pages. Use the next_token from the response to fetch additional pages.

How it works

  1. Make your initial request with max_results
  2. Check the meta object for next_token
  3. Include next_token in subsequent requests
  4. Repeat until no next_token is returned

Example

cURL

Pagination guide

Learn more about pagination

Post edits

Posts can be edited up to 5 times within 30 minutes. The search endpoints always return the most recent version.

Considerations

  • edit_history_tweet_ids contains all Post IDs (oldest first)
  • Posts fetched after the 30-minute window represent the final version
  • For near-real-time use cases, recently-published Posts may still be edited

Edit Posts fundamentals

Learn more about Post edits

Best practices

Start specific

Use multiple operators to narrow results and reduce noise.

Test iteratively

Start broad, then refine based on results.

Handle pagination

Implement proper pagination for large result sets.

Cache results

Store results locally to avoid repeated requests.

Next steps

Build a query

Master query syntax

Operator reference

All available operators

Pagination

Handle large result sets

API Reference

Full endpoint documentation