For the complete documentation index, see llms.txt. This page is also available as Markdown.

Twitter / X

Twitter: tweets, users, handles, and search. All endpoints are read-only GET requests and return public Twitter/X data — no posting or account access is included.

Base URL: https://api.pullbay.com/

Endpoints

Endpoint
Description
Pagination

GET /twitter/search

Search tweets by query

Cursor / maxItems

GET /twitter/tweet/{id}

Get a single tweet by ID

—

GET /twitter/handle/{handle}

Get a user by handle

—

GET /twitter/handle/{handle}/about

Get a user's about/bio details by handle

—

GET /twitter/user/{id}

Get a user by numeric ID

—

GET /twitter/user/{id}/tweets

Get tweets posted by a user

Cursor / maxItems


Search Twitter

Search tweets matching a query.

Request

GET /twitter/search
Authorization: Bearer YOUR_API_KEY

Parameters

Parameter
Type
Required
Description

query

string

Yes

Search query, 1–100 characters

sort

string

No

Top or Latest (default Latest)

useFirst

string

No

true or false (default false)

cursor

string

No

Pagination cursor from a previous response. Mutually exclusive with maxItems

maxItems

integer

No

One-shot bulk pull, 1–200 results. Mutually exclusive with cursor

Example

Response

Credit cost: dynamic, returned in pricing.creditsCharged. Using maxItems to pull more results in one call costs proportionally more than a single page.


Get Tweet

Returns a single tweet by its numeric ID.

Request

Parameters

Parameter
Type
Required
Description

id

string

Yes

Numeric tweet ID, 1–100 characters (e.g. 20)

Example

Response

Credit cost: dynamic, returned in pricing.creditsCharged.


Get User By Handle

Returns a Twitter user by handle (without @).

Request

Parameters

Parameter
Type
Required
Description

handle

string

Yes

Twitter handle without @, 1–100 characters (e.g. elonmusk)

Example

Response

Credit cost: dynamic, returned in pricing.creditsCharged.


Get User About By Handle

Returns extended profile / about details for a Twitter user, by handle.

Request

Parameters

Parameter
Type
Required
Description

handle

string

Yes

Twitter handle without @, 1–100 characters (e.g. elonmusk)

Example

Response

Credit cost: dynamic, returned in pricing.creditsCharged.


Get User By ID

Returns a Twitter user by their numeric user ID.

Request

Parameters

Parameter
Type
Required
Description

id

string

Yes

Numeric Twitter user ID, 1–100 characters (e.g. 44196397)

Example

Response

Credit cost: dynamic, returned in pricing.creditsCharged.


Get User's Tweets

Returns tweets posted by a user, by user ID.

Request

Parameters

Parameter
Type
Required
Description

id

string

Yes

Numeric Twitter user ID, 1–100 characters (e.g. 44196397)

cursor

string

No

Pagination cursor from a previous response. Mutually exclusive with maxItems

maxItems

integer

No

One-shot bulk pull, 1–200 results. Mutually exclusive with cursor

Example

Response

Credit cost: dynamic, returned in pricing.creditsCharged. Cost scales with the number of tweets returned, not the number of requests.


Object schemas

User object

Field
Type
Description

type

string

Always user

id

string

Numeric Twitter user ID

userName

string

Handle, without @

name

string

Display name

url / twitterUrl

string

Profile URL on x.com and twitter.com

description

string

Bio text

location

string

Free-text profile location

profilePicture / coverPicture

string

Avatar and banner image URLs

isVerified / isBlueVerified

boolean

Legacy verification and Blue subscriber verification

protected

boolean

Whether the account's tweets are protected

canDm / canMediaTag

boolean

Whether the user accepts DMs / can be tagged in media

followers / following

integer

Follower and following counts

fastFollowersCount

integer

Recently-gained follower count

favouritesCount

integer

Total likes given by the user

listedCount

integer

Number of lists the user appears on

mediaCount

integer

Number of tweets containing media

statusesCount

integer

Total tweet count

createdAt

string

Account creation timestamp (Twitter date format)

status

string

Reserved/internal status field

Tweet object

Field
Type
Description

type

string

Always tweet

id

string

Numeric tweet ID

url / twitterUrl

string

Tweet permalink on x.com and twitter.com

text / fullText

string

Tweet body (truncated and full)

source

string

Client used to post the tweet

lang

string

Tweet language code

createdAt

string

Posted timestamp (Twitter date format)

conversationId

string

ID of the root tweet in the thread

retweetCount / replyCount / likeCount / quoteCount / bookmarkCount

integer

Engagement counts

viewCount

integer, nullable

View count, when available

isReply / isPinned / isRetweet / isQuote

boolean

Tweet type flags

author

The tweet's author

media

array

Attached media objects

User about object

Field
Type
Description

accountBasedIn

string

Inferred account region

locationAccurate

boolean

Whether accountBasedIn is considered accurate

profileImageShape

string

Profile picture mask shape (e.g. Circle)

avatarUrl

string

Avatar image URL

usernameChangeCount

string

Number of times the handle has been changed

accountCreatedAt

string

Account creation timestamp (Twitter date format)

accountSource

string

Platform/channel the account was created from

verifiedSince

string

Verification timestamp, when applicable


Errors

All non-2xx responses share the same envelope:

Status
Meaning

400

Bad request — missing/invalid parameters

402

Insufficient credits

404

Tweet or user not found

Looking Up Users: Handle vs. ID

Twitter users can be resolved two ways, and the right one depends on what you already have:

  • By handle (/twitter/handle/{handle}, /twitter/handle/{handle}/about) — use when you have the @username (without the @). This is the natural entry point when a human gives you a Twitter handle.

  • By numeric ID (/twitter/user/{id}, /twitter/user/{id}/tweets) — use when you already have the user's numeric ID, typically because you pulled it from author.id on a tweet or from a prior handle lookup's id field. Numeric IDs are stable even if a user changes their handle, so prefer caching the ID for repeated lookups.

This mirrors the Instagram service's handle-vs-ID split: resolve once by handle to get the numeric ID, then use the ID for subsequent lookups (like fetching a user's tweets) to avoid re-resolving the handle each time.

Profile detail also comes in two levels:

  • Basic profile (/twitter/handle/{handle}, /twitter/user/{id}) — followers, bio, verification status, and engagement counters. Use this for most lookups.

  • About / extended profile (/twitter/handle/{handle}/about) — additional metadata not on the basic profile, such as inferred account region, profile image shape, username change count, and verification timestamp. Only available via handle, not by numeric ID. Call this in addition to the basic profile when you need these extra fields.

Last updated