From Tweet to Token Alert: Why Speed Matters
Crypto traders watch Twitter for new token mentions, contract addresses in screenshots, and reports of on-chain activity. These posts still need to be detected, parsed, and checked before a trader or bot can use them.
A tweet-to-trade pipeline needs three things: real-time tweet detection, automatic token extraction (from text and images), and instant price validation. DexScreener is the missing piece that turns a raw token symbol into a tradeable pair with live pricing.
What Is DexScreener?
DexScreener is a real-time DEX (decentralized exchange) aggregator that tracks token pairs across major blockchains including Ethereum, Solana, BSC, Arbitrum, Base, and dozens more. It provides live price charts, trading volume, liquidity data, and transaction history for any token with an active trading pair.
Trading bots can use DexScreener's API to check whether a token has an active pair, inspect its liquidity, and read its current price.
DexScreener API: Key Endpoints
DexScreener exposes multiple public endpoints without an API key, but rate limits vary by endpoint family. Check the current reference before you wire a production pipeline to a specific route:
| Endpoint | Use Case | Example |
|---|---|---|
| GET /latest/dex/search?q={query} | Search for tokens by name or symbol | /latest/dex/search?q=PEPE |
| GET /latest/dex/pairs/{chainId}/{pairId} | Get a specific trading pair | /latest/dex/pairs/solana/{pair_address} |
| GET /token-pairs/v1/{chainId}/{tokenAddress} | Get all pairs for a token address on one chain | /token-pairs/v1/solana/So11111111111111111111111111111112 |
| GET /tokens/v1/{chainId}/{tokenAddresses} | Look up one or more token addresses on one chain | /tokens/v1/ethereum/0x6982508145454Ce325dDbE47a25d4ec3d2311933 |
| GET /token-profiles/latest/v1 | Get recently updated token profiles | /token-profiles/latest/v1 |
Response shape and rate limits differ across these routes, so confirm the current docs before you standardize your ingestion code. Official DexScreener API reference.
Building the Token Detection Pipeline
The workflow has four stages:
- Stage 1: Receive posts from selected accounts over WebSocket or another streaming API.
- Stage 2: Parse post text for $TICKER symbols, contract addresses, and DEX URLs.
- Stage 3: Run OCR on attached images to find tokens in screenshots, charts, and announcements.
- Stage 4: Query the DexScreener API to check for active pairs, liquidity, and current prices.
OCR: Catching Tokens Hidden in Images
Many crypto influencers share token information in chart screenshots, trading terminal images, or announcement graphics with contract addresses. A text-only pipeline misses them.
OCR (Optical Character Recognition) extracts text from images attached to tweets. The extracted text is then scanned for the same patterns: $TICKER symbols, contract addresses, and DEX URLs. This catches contract addresses in chart screenshots that a trader would otherwise have to type out character by character.
When OCR enrichment is available for an image attachment, TweetStream can include extracted text and detected token references in the alert payload.
Code Example: Token Lookup with DexScreener API
// Look up a token on DexScreener by chain + address
async function lookupToken(chainId: string, address: string) {
const res = await fetch(
`https://api.dexscreener.com/tokens/v1/${chainId}/${address}`
);
const pairs = await res.json();
if (!pairs?.length) {
console.log('No trading pairs found');
return null;
}
// Get the highest-liquidity pair
const topPair = pairs.sort(
(a, b) => (b.liquidity?.usd ?? 0) - (a.liquidity?.usd ?? 0)
)[0];
return {
symbol: topPair.baseToken.symbol,
name: topPair.baseToken.name,
price: topPair.priceUsd,
priceChange24h: topPair.priceChange?.h24,
volume24h: topPair.volume?.h24,
liquidity: topPair.liquidity?.usd,
dex: topPair.dexId,
chain: topPair.chainId,
pairUrl: topPair.url,
};
}
// Example: look up PEPE on Ethereum
const token = await lookupToken('ethereum', '0x6982508145454Ce325dDbE47a25d4ec3d2311933');
console.log(token);
// { symbol: 'PEPE', price: '0.00001234', liquidity: 5200000, ... }Code Example: Full Detection Pipeline
// Full tweet → token → price pipeline
const TICKER_REGEX = /\$([A-Z]{2,10})\b/g;
const EVM_ADDR_REGEX = /0x[a-fA-F0-9]{40}/g;
const SOLANA_ADDR_REGEX = /[1-9A-HJ-NP-Za-km-z]{32,44}/g;
async function searchToken(query: string) {
const res = await fetch(
`https://api.dexscreener.com/latest/dex/search?q=${encodeURIComponent(query)}`
);
const data = await res.json();
return data.pairs ?? [];
}
async function processTweet(tweet: { text: string; ocr?: { text?: string } }) {
const allText = [tweet.text, tweet.ocr?.text ?? ''].join(' ');
const results = [];
// Extract $TICKER symbols
for (const match of allText.matchAll(TICKER_REGEX)) {
const pairs = await searchToken(match[1]);
if (pairs[0]) {
results.push(pairs[0]);
}
}
// Extract EVM contract addresses
for (const match of allText.matchAll(EVM_ADDR_REGEX)) {
const data = await lookupToken('ethereum', match[0]);
if (data && (data.liquidity ?? 0) > 10_000) {
results.push(data);
}
}
// Extract Solana addresses
for (const match of allText.matchAll(SOLANA_ADDR_REGEX)) {
const data = await lookupToken('solana', match[0]);
if (data && (data.liquidity ?? 0) > 10_000) {
results.push(data);
}
}
return results;
}Supported Chains and Token Types
DexScreener aggregates data across all major EVM and non-EVM chains:
- EVM chains: Ethereum, BSC, Arbitrum, Base, Polygon, Avalanche, Optimism, Fantom
- Solana: SPL tokens including pump.fun launches
- Other L1s: Sui, Aptos, Near, Tron, Cosmos ecosystem
- DEX coverage: Uniswap, Raydium, PancakeSwap, Jupiter, and hundreds more
If your watchlist focuses on Solana or Base launches, resolve those chains first and keep ambiguous symbols out of automated decisions.
Skip the separate ingest and enrichment stack
TweetStream combines selected-account delivery with token detection, OCR, and live price context when those enrichments are available.
Alerts can include tokens detected from text or images, extracted OCR text, live price context, and prediction-market context when present. See the payloads and OCR docs for the payload structure.
Put this workflow into production faster
This guide covers the workflow. TweetStream handles monitored-post ingestion, token detection, and OCR, then delivers posts, updates, deletes, pins, profile changes, follows, unfollows, and enriched JSON payloads over WebSocket. Supported plans also include history. Your client reconnects the WebSocket as documented and routes received events downstream. Start a 3-day trial with your own accounts.
Start 3-day trialFrequently Asked Questions
TweetStream Team
Last updated: August 25, 2026