# Twitter/X Posts Scraper by Profile

> Twitter/X Posts Scraper by Profile is a paid API for AI agents from api.scrapeforagents.tech, paid per call via x402, $0.025/call, status unknown (last checked 2026-10-02).

Scrapes and filters recent posts from specified Twitter/X public profiles, returning structured post data with optional text/hashtag filtering and time windowing.

## Facts

- Endpoint: POST https://api.scrapeforagents.tech/v1/twitter-posts?utm_source=zero.xyz
- Price: $0.025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/twitter-x-posts-scraper-by-profile-f252ce6a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IBjW_tmhCoM25Jk4YBMSF

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability twitter-x-posts-scraper-by-profile-f252ce6a -d '<json body>'
```

Example prompt: Pull the latest 20 posts from @elonmusk and @naval on X from the past 3 days, filtering for any posts that mention 'AI' — sort by most recent.

## When to prefer this

Choose this endpoint when you need structured post data from specific known Twitter/X accounts rather than a site-wide keyword search. It is ideal for monitoring named profiles, extracting posts for sentiment analysis, or tracking what specific users or brands are posting. Prefer it over general social media APIs when you need pay-per-call pricing with no charge on empty results.

## Known failure modes

- Private or suspended accounts return no results — charge may be waived
- Invalid or non-existent usernames produce empty item arrays
- timeWindowHours and timeWindow both set — hours takes precedence, days value ignored
- resultsCount exceeding available public posts returns fewer items than requested
- Rate limits or anti-scraping measures on X may cause partial or failed runs — not charged on failure

## How this service works

Pay-per-call structured web data. Failed or empty runs are not charged.

## Output

A JSON object containing a count of matched posts and an array of post items, each with post ID, URL, full text, author handle, timestamp, reply count, conversation ID, and any attached media references.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "default": "",
   "description": "Optional case-insensitive text or hashtag match within posts from the supplied profiles. This is not site-wide search."
  },
  "usernames": {
   "type": "array",
   "description": "Public account handles or profile URLs to inspect. Only the recent posts visible on these pages are searched."
  },
  "searchType": {
   "enum": [
    "latest",
    "top"
   ],
   "type": "string",
   "default": "latest",
   "description": "Sort collected posts by publication time or by likes among the public slice."
  },
  "timeWindow": {
   "type": "integer",
   "minimum": 1,
   "description": "Optional age limit in days. Hours takes precedence when both are set."
  },
  "resultsCount": {
   "type": "integer",
   "default": 30,
   "minimum": 1,
   "description": "Maximum number of matching posts in the result dataset across all profiles."
  },
  "timeWindowHours": {
   "type": "integer",
   "minimum": 1,
   "description": "Optional age limit in hours; overrides the day limit."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "items": [
   {
    "media": null,
    "author": null,
    "postId": null,
    "postUrl": null,
    "postText": null,
    "timestamp": null,
    "replyCount": null,
    "conversationId": null
   }
  ],
  "product": "twitter-posts"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/twitter-x-posts-scraper-by-profile-f252ce6a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.scrapeforagents.tech](https://www.zero.xyz/host/api.scrapeforagents.tech/llms.txt)
