GET
/
tweets
/
search
Get Twitter/X user data and tweets
curl --request GET \
  --url https://api.fcontext.com/tweets/search \
  --header 'X-API-Key: <api-key>'
{
  "success": true,
  "data": {
    "user": "dhh",
    "fromDate": "2025-01-16",
    "toDate": "2025-01-16",
    "total_tweets": 3,
    "tweets": [
      {
        "id": "1234567890123456789",
        "timestamp": "2025-01-16T10:30:00Z",
        "content": "Just shipped a new feature for Rails 8.0! The developer experience keeps getting better. #Rails #WebDev",
        "engagement": {
          "likes": 245,
          "reposts": 67,
          "quotes": 12,
          "replies": 34,
          "bookmarks": 89,
          "views": 5420
        },
        "media": {
          "type": "photo",
          "url": "https://pbs.twimg.com/media/example.jpg"
        },
        "quoted_post": null
      },
      {
        "id": "1234567890123456790",
        "timestamp": "2025-01-16T08:15:00Z",
        "content": "Working on some exciting database optimizations. Performance improvements are always satisfying to implement.",
        "engagement": {
          "likes": 156,
          "reposts": 23,
          "quotes": 5,
          "replies": 18,
          "bookmarks": 45,
          "views": 2890
        },
        "media": null,
        "quoted_post": "Previous discussion about database scaling strategies..."
      }
    ]
  },
  "message": "Twitter/X user data and tweets retrieved successfully",
  "timestamp": "2025-01-16T10:30:00.000Z",
  "meta": {
    "pagination": {
      "currentPage": 1,
      "pageSize": 3,
      "totalItems": 3,
      "totalPages": 1,
      "hasMore": false
    }
  }
}

Authorizations

X-API-Key
string
header
required

Query Parameters

xhandles
string
required

Comma-separated list of X handles to search (without @ symbol, max 3)

Minimum length: 1
fromDate
string

Start date for search data in ISO8601 format (YYYY-MM-DD)

toDate
string

End date for search data in ISO8601 format (YYYY-MM-DD)

maxResults
number
default:10

Maximum number of search results to consider (max 50)

Required range: 1 <= x <= 50
maxSearchResults
number
default:20

Maximum number of search results to consider. Defaults to 20, max 50

Required range: 1 <= x <= 50

Response

Twitter/X user data and tweets retrieved successfully

success
boolean
required

Indicates successful API response

data
object
required
timestamp
string
required

ISO 8601 timestamp of the response

message
string

Optional success message

meta
object

Optional metadata including pagination, statistics, and additional context