# Twitter/X Public Post Scraper

> Twitter/X Public Post Scraper 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 public Twitter/X posts from profile URLs, direct post URLs, or account handles and returns structured post data including text, timestamps, and engagement metrics.

## Facts

- Endpoint: POST https://api.scrapeforagents.tech/v1/twitter?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-public-post-scraper-ba3969c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P2y6qilz2UIiyfudbvNgQ

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-public-post-scraper-ba3969c1 -d '<json body>'
```

Example prompt: Pull the last 20 public posts from the Twitter handle @elonmusk and give me the text, timestamps, and retweet counts for each one.

## When to prefer this

Choose this endpoint when you need structured public Twitter/X post data without authentication, want pay-per-successful-call pricing (failed/empty runs are free), and only need the first page of recent posts from public profiles. Best for lightweight monitoring, quick data pulls on known handles, or building datasets from a small list of accounts. Not suitable for deep historical scraping, private accounts, or general keyword search.

## Known failure modes

- Private or suspended accounts return empty results but are not charged
- Search/keyword terms that require login return no results
- List or search URLs are unsupported and will fail
- Each handle only exposes up to 5 recent posts to anonymous visitors, limiting depth
- Rate limits or blocks from Twitter may result in empty runs (not charged)
- Invalid handles or malformed URLs return empty item arrays

## How this service works

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

## Output

Returns a JSON object with a count of items retrieved, the product name ('twitter'), and an array of post objects each containing: post ID, post URL, Twitter URL, language code, post text, post type, creation timestamp, and retweet count. Null fields indicate data that wasn't available from the public page.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "maxItems": {
   "type": "integer",
   "default": 30,
   "minimum": 0,
   "description": "Maximum number of unique posts across all inputs. Set 0 for no output cap; each profile still exposes only its public first page."
  },
  "startUrls": {
   "type": "array",
   "description": "Public twitter.com or x.com profile and direct post URLs. Search and list URLs are unavailable."
  },
  "searchTerms": {
   "type": "array",
   "description": "Single from:handle terms only. General keyword search requires sign-in and is unavailable."
  },
  "twitterHandles": {
   "type": "array",
   "description": "Public account handles. Each profile currently exposes up to five recent posts to anonymous visitors."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "items": [
   {
    "id": null,
    "url": null,
    "lang": null,
    "text": null,
    "type": null,
    "createdAt": null,
    "twitterUrl": null,
    "retweetCount": null
   }
  ],
  "product": "twitter"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/twitter-x-public-post-scraper-ba3969c1/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)
