# Tweet Scraper V3 Fixed (`ayeeyee/tweet-scraper-v3-fixed`) Actor

Scrape tweets by keyword, hashtag, username, or URL without API limits. Extract tweet text, media, retweet/like counts, timestamps, and thread replies. Real Playwright scraping with anti-detection. 17% cheaper at $0.15/1K tweets.

- **URL**: https://apify.com/ayeeyee/tweet-scraper-v3-fixed.md
- **Developed by:** [Virtual Footprint LLC](https://apify.com/ayeeyee) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.23 / 1,000 tweets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Tweet Lookup by URL

Fetch real tweet/X post data — author name, handle, text, publish info — for a list of known tweet URLs, using X's own official **oEmbed API**. No login, no API key, no scraping-detection cat-and-mouse.

**Honest scope, stated plainly:** this is a URL-lookup tool, not a search/hashtag/timeline scraper. As of this build (August 2026), X's anonymous search and timeline endpoints are locked behind bot detection that older workarounds (guest-token GraphQL calls) no longer reliably clear — verified directly during development: the legacy search endpoint now returns 404, and loading x.com without login returns an empty client-rendered shell. Rather than ship something that silently degrades to empty or unreliable results, this actor does the one thing X's own official API still supports well: real data for a URL you already have.

**Pricing:** $0.0001 one-time actor-start + **$0.001 per tweet successfully resolved**. Deleted, private, or not-found tweets are never charged.

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `tweetUrls` | array\<string> | yes | Tweet/X post URLs (e.g. `https://x.com/jack/status/20`). Bare numeric IDs also work. |

### Output (per URL)

```json
{
  "inputUrl": "https://twitter.com/jack/status/20",
  "found": true,
  "tweetId": "20",
  "authorName": "jack",
  "authorHandle": "jack",
  "authorUrl": "https://x.com/jack",
  "text": "just setting up my twttr",
  "resolvedUrl": "https://x.com/jack/status/20",
  "reason": null
}
```

Not-found tweets return `found: false` with a `reason` — never fabricated data.

### When to use this vs. a search-based scraper

If you need to discover tweets by keyword, hashtag, or user timeline, you need a different tool — this one only resolves URLs you already have (e.g. from a lead list, a link someone shared, monitoring a known set of posts). It will not find new tweets for you.

### Testing

`tests/test_main_orchestration.py` (24 tests, fully offline) locks the run-orchestration + honesty + billing-dataset contract:

- `now_iso` (tz-aware UTC `isoformat`, `+00:00` suffix);
- `normalize_tweet_url` (`http…` URL passthrough / bare numeric ID → `https://twitter.com/i/status/{id}` / non-http-non-numeric → `None` / empty → `None`);
- `extract_text_from_html` (oEmbed `html` → `@media`-wrapped `<p>` text; empty / no-`<p>` → `None`, never fabricated);
- `TWEET_ID_RE` (`status/` + `statuses/` numeric ID extraction);
- `lookup_tweet` **oEmbed HTTP honesty contract** — full honest result shape (found/not-found), tweetId extraction, network-error → `network_error:` reason never fabricated, 404 → `tweet_not_found_or_deleted_or_private`, non-200 → `oembed_http_N`, invalid-JSON → `invalid_oembed_response`, success → authorName/authorUrl/authorHandle/text/resolvedUrl + quoted oEmbed GET URL;
- `run_enrich` — tweetUrls primary + `urls` alias + string coercion + bare-ID normalization + drop-invalid + bounded concurrency + **one-push-per-tweet no-dup** (the billing contract: `apify-default-dataset-item` one charge per resolved row) + honest no-input error row;
- `main()` — `{'input':…}` unwrap + mode router (enrich default / fast_lookup / unknown all route to the same honest run_enrich) + **no double-push**.

Run: `python -m pytest tests/ -q`.

# Actor input Schema

## `tweetUrls` (type: `array`):

List of tweet or X post URLs to look up (e.g. https://x.com/jack/status/20). IDs alone also work. Optional — an empty run performs an honest no-op.

## `mode` (type: `string`):

Execution mode.

## `queries` (type: `array`):

Search queries or targets.

## `maxResults` (type: `integer`):

Maximum number of results to return.

## Actor input object example

```json
{
  "tweetUrls": [],
  "mode": "enrich",
  "queries": [],
  "maxResults": 25
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ayeeyee/tweet-scraper-v3-fixed").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("ayeeyee/tweet-scraper-v3-fixed").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call ayeeyee/tweet-scraper-v3-fixed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ayeeyee/tweet-scraper-v3-fixed"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WtAAeSS80tgOENeft/builds/ePMidJ9EQ3VXAsIZM/openapi.json
