Twitter API — Endpoints — FetchLayer Docs
FetchLayer fetchlayer.dev Sign in

Endpoints

All endpoints follow the same pattern: POST https://api.fetchlayer.dev/twitter/{endpoint} with a JSON body and Bearer auth header.

OpenAPI JSON

Profile

User profile metadata and account context.

OpenAPI JSON
POST /user-profile-details Profile
https://api.fetchlayer.dev/twitter/user-profile-details

Fetch a user profile by handle

Retrieve a Twitter user profile and top-level account metadata by handle. Includes bio, follower/following counts, join date, and verification status.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.

Example Request

json
{
  "handle": "openai"
}

Example Response

json
{
  "handle": "OpenAI",
  "displayName": "OpenAI",
  "description": "AI research and deployment company. Creators of ChatGPT, GPT-4, DALL·E, and Sora.",
  "isVerified": true,
  "followersCount": 4300000,
  "followingCount": 82,
  "tweetsCount": 3400,
  "joinedAt": "2015-12-11T00:00:00.000Z",
  "location": "San Francisco, CA",
  "website": "https://openai.com",
  "avatarUrl": "https://pbs.twimg.com/profile_images/openai_normal.jpg",
  "bannerUrl": "https://pbs.twimg.com/profile_banners/openai_header.jpg"
}

Response Fields

user-profile-details

Fetch a user profile by handle

Field Type Description
handle string Twitter handle.
displayName string Display name.
description string Bio text.
isVerified boolean Verification status.
followersCount number Follower count.
followingCount number Following count.
tweetsCount number Total tweet count.
joinedAt string Account creation timestamp (ISO 8601).
location string Profile location (optional).
website string Profile website URL (optional).
avatarUrl string Profile image URL.
bannerUrl string Header banner URL (optional).
POST /about-profile Profile
https://api.fetchlayer.dev/twitter/about-profile

Fetch “about this profile” metadata

Retrieve extended profile context for a Twitter account including professional category, and any linked entities.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.

Example Request

json
{
  "handle": "openai"
}

Example Response

json
{
  "handle": "OpenAI",
  "category": "Technology",
  "isBusiness": true,
  "isGovernment": false,
  "affiliates": []
}

Response Fields

about-profile

Fetch “about this profile” metadata

Field Type Description
handle string Twitter handle.
category string Professional category label.
isBusiness boolean Whether the account is marked as a business.
isGovernment boolean Whether the account is marked as a government entity.
affiliates[] array Affiliated accounts or entities.

Content

Tweets, replies, and detailed thread data.

OpenAPI JSON
POST /tweet-detail Content
https://api.fetchlayer.dev/twitter/tweet-detail

Fetch a tweet by ID

Retrieve detailed metadata for a specific tweet by ID including full text, media, engagement stats, and thread context.

Parameters

Name Type Required Description
tweetId string Yes Tweet ID.
screenName string No Optional screen name context for URL construction.

Example Request

json
{
  "tweetId": "1942939879222220800"
}

Example Response

json
{
  "id": "1942939879222220800",
  "text": "Just tried the new GPT-4o vision features on the OpenAI playground — it correctly described a screenshot of our dashboard in one prompt. Incredible.",
  "author": {
    "handle": "devuser",
    "displayName": "Dev User",
    "isVerified": false,
    "followersCount": 3200
  },
  "createdAt": "2026-07-01T18:42:00.000Z",
  "likeCount": 142,
  "retweetCount": 31,
  "replyCount": 23,
  "quoteCount": 4,
  "viewCount": 8200,
  "url": "https://x.com/devuser/status/1942939879222220800",
  "lang": "en",
  "media": []
}

Response Fields

tweet-detail

Fetch a tweet by ID

Field Type Description
id string Unique tweet identifier.
text string Full tweet text.
author.handle string Author handle.
author.displayName string Author display name.
author.isVerified boolean Verified status.
author.followersCount number Author follower count.
createdAt string ISO 8601 timestamp.
likeCount number Like count.
retweetCount number Retweet/repost count.
replyCount number Reply count.
quoteCount number Quote tweet count.
viewCount number Impression count.
url string Canonical tweet URL.
lang string BCP 47 language code.
media[] array Attached media (photos, videos, cards).
POST /tweet-replies Content
https://api.fetchlayer.dev/twitter/tweet-replies

Fetch replies for a tweet

Retrieve reply tweets and continuation cursors for a specific tweet. Each reply includes the same fields as a tweet result.

Parameters

Name Type Required Description
tweetId string Yes Tweet ID.
screenName string No Optional screen name context.
cursor string No Pagination cursor.

Example Request

json
{
  "tweetId": "1942939879222220800"
}

Example Response

json
{
  "replies": [
    {
      "id": "1942941234567890000",
      "text": "Absolutely. I used it to analyze a full Next.js project structure and it caught a race condition I missed.",
      "author": {
        "handle": "reactdev",
        "displayName": "React Dev",
        "isVerified": false
      },
      "createdAt": "2026-07-01T19:05:00.000Z",
      "likeCount": 28,
      "retweetCount": 2,
      "replyCount": 5
    },
    {
      "id": "1942942345678900000",
      "text": "How does it compare to Claude Computer Use for those kinds of tasks?",
      "author": {
        "handle": "ai_researcher",
        "displayName": "AI Researcher",
        "isVerified": false
      },
      "createdAt": "2026-07-01T19:12:00.000Z",
      "likeCount": 12,
      "retweetCount": 0,
      "replyCount": 8
    }
  ],
  "cursor": "DAABCgABF8zK9v__-W9"
}

Response Fields

tweet-replies

Fetch replies for a tweet

Field Type Description
replies[].id string Reply tweet ID.
replies[].text string Reply text.
replies[].author.handle string Author handle.
replies[].author.displayName string Author display name.
replies[].createdAt string ISO 8601 timestamp.
replies[].likeCount number Like count.
replies[].retweetCount number Retweet count.
replies[].replyCount number Nested reply count.
cursor string Pagination cursor for next page.
POST /user-tweets Content
https://api.fetchlayer.dev/twitter/user-tweets

Fetch tweets for a user

Retrieve timeline tweets for a user handle with full engagement data and pagination support.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.
count number No Number of tweets (max 100). (default: 25)
cursor string No Pagination cursor for next page.

Example Request

json
{
  "handle": "openai",
  "count": 3
}

Example Response

json
{
  "tweets": [
    {
      "id": "1942900000000000000",
      "text": "Introducing GPT-4.1 — our most capable model yet, with improved reasoning, coding, and instruction following. Rolling out to API users starting today.",
      "createdAt": "2026-07-01T14:00:00.000Z",
      "likeCount": 12500,
      "replyCount": 2100,
      "retweetCount": 3400,
      "viewCount": 1200000,
      "url": "https://x.com/OpenAI/status/1942900000000000000"
    },
    {
      "id": "1942800000000000000",
      "text": "Sora is now available to all ChatGPT Plus and Pro subscribers. Create realistic and imaginative videos from text instructions.",
      "createdAt": "2026-06-30T16:00:00.000Z",
      "likeCount": 9800,
      "replyCount": 1600,
      "retweetCount": 2800,
      "viewCount": 950000,
      "url": "https://x.com/OpenAI/status/1942800000000000000"
    }
  ],
  "cursor": "DAABCgABF8zK9v__-X0"
}

Response Fields

user-tweets

Fetch tweets for a user

Field Type Description
tweets[].id string Tweet ID.
tweets[].text string Full tweet text.
tweets[].createdAt string ISO 8601 timestamp.
tweets[].likeCount number Like count.
tweets[].replyCount number Reply count.
tweets[].retweetCount number Retweet count.
tweets[].viewCount number Impression count.
tweets[].url string Canonical tweet URL.
cursor string Pagination cursor.
POST /user-replies Content
https://api.fetchlayer.dev/twitter/user-replies

Fetch replies by a user

Retrieve recent replies authored by a user handle across different tweet threads.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.
count number No Number of replies (max 100). (default: 25)
cursor string No Pagination cursor.

Example Request

json
{
  "handle": "sama",
  "count": 3
}

Example Response

json
{
  "replies": [
    {
      "id": "1942950000000000000",
      "text": "We think this is the most important capability for agents. More to share soon.",
      "inReplyToId": "1942900000000000000",
      "author": {
        "handle": "sama",
        "displayName": "Sam Altman"
      },
      "createdAt": "2026-07-01T15:30:00.000Z",
      "likeCount": 4200
    }
  ],
  "cursor": "DAABCgABF8zK9v__-Y1"
}

Response Fields

user-replies

Fetch replies by a user

Field Type Description
replies[].id string Reply tweet ID.
replies[].text string Reply text.
replies[].inReplyToId string Tweet ID being replied to.
replies[].author.handle string Author handle.
replies[].createdAt string ISO 8601 timestamp.
replies[].likeCount number Like count.
cursor string Pagination cursor.

Network

Followers, following, and audience graph lookups.

OpenAPI JSON
POST /following Network
https://api.fetchlayer.dev/twitter/following

Fetch following list

Retrieve accounts followed by a user with basic profile metadata per account.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.
count number No Number of accounts (max 100). (default: 25)
cursor string No Pagination cursor.

Example Request

json
{
  "handle": "sama",
  "count": 3
}

Example Response

json
{
  "users": [
    {
      "handle": "gdb",
      "displayName": "Greg Brockman",
      "description": "President & Co-Founder @OpenAI.",
      "isVerified": true,
      "followersCount": 1200000,
      "avatarUrl": "https://pbs.twimg.com/profile_images/gdb_normal.jpg"
    },
    {
      "handle": "miramurati",
      "displayName": "Mira Murati",
      "description": "CTO @OpenAI.",
      "isVerified": true,
      "followersCount": 450000,
      "avatarUrl": "https://pbs.twimg.com/profile_images/mira_normal.jpg"
    }
  ],
  "cursor": "DAABCgABF8zK9v__-Z2"
}

Response Fields

following

Fetch following list

Field Type Description
users[].handle string User handle.
users[].displayName string Display name.
users[].description string Bio text.
users[].isVerified boolean Verification status.
users[].followersCount number Follower count.
users[].avatarUrl string Profile image URL.
cursor string Pagination cursor.
POST /followers Network
https://api.fetchlayer.dev/twitter/followers

Fetch followers list

Retrieve follower accounts for a user with the same profile metadata shape as the following endpoint.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.
count number No Number of accounts (max 100). (default: 25)
cursor string No Pagination cursor.

Example Request

json
{
  "handle": "sama",
  "count": 2
}

Example Response

json
{
  "users": [
    {
      "handle": "karpathy",
      "displayName": "Andrej Karpathy",
      "description": "Building @EurekaLabsAI. Previously: Director of AI @Tesla, founding team @OpenAI, CS PhD @Stanford.",
      "isVerified": true,
      "followersCount": 1100000,
      "avatarUrl": "https://pbs.twimg.com/profile_images/karpathy_normal.jpg"
    },
    {
      "handle": "ylecun",
      "displayName": "Yann LeCun",
      "description": "Professor at NYU. Chief AI Scientist at Meta. Turing Award. Researcher in AI, Machine Learning, Robotics, etc.",
      "isVerified": true,
      "followersCount": 850000,
      "avatarUrl": "https://pbs.twimg.com/profile_images/ylecun_normal.jpg"
    }
  ],
  "cursor": "DAABCgABF8zK9v__-Z3"
}

Response Fields

followers

Fetch followers list

Field Type Description
users[].handle string User handle.
users[].displayName string Display name.
users[].description string Bio text.
users[].isVerified boolean Verification status.
users[].followersCount number Follower count.
users[].avatarUrl string Profile image URL.
cursor string Pagination cursor.
POST /verified-followers Network
https://api.fetchlayer.dev/twitter/verified-followers

Fetch blue-verified followers

Retrieve blue-verified followers for a user — useful for filtering high-signal accounts from large follower lists. Returns the same profile shape as the followers endpoint.

Parameters

Name Type Required Description
handle string Yes Twitter handle without @.
count number No Number of accounts (max 100). (default: 25)
cursor string No Pagination cursor.

Example Request

json
{
  "handle": "openai",
  "count": 2
}

Example Response

json
{
  "users": [
    {
      "handle": "satyanadella",
      "displayName": "Satya Nadella",
      "description": "Chairman and CEO at Microsoft.",
      "isVerified": true,
      "followersCount": 3200000,
      "avatarUrl": "https://pbs.twimg.com/profile_images/satya_normal.jpg"
    },
    {
      "handle": "elonmusk",
      "displayName": "Elon Musk",
      "description": "Mars & Cars, Chips & Dips",
      "isVerified": true,
      "followersCount": 180000000,
      "avatarUrl": "https://pbs.twimg.com/profile_images/elon_normal.jpg"
    }
  ],
  "cursor": "DAABCgABF8zK9v__-Z4"
}

Response Fields

verified-followers

Fetch blue-verified followers

Field Type Description
users[].handle string User handle.
users[].displayName string Display name.
users[].description string Bio text.
users[].isVerified boolean Always true for this endpoint.
users[].followersCount number Follower count.
users[].avatarUrl string Profile image URL.
cursor string Pagination cursor.

Search

Keyword and product-based Twitter search.

OpenAPI JSON