Skip to main content
← Back to blog
by Engineering
tutorialquickstart

Getting Started with XCROP API in 5 Minutes

Why XCROP?

XCROP provides the most comprehensive X/Twitter data API built specifically for crypto traders, researchers, and builders. With 39 endpoints, interaction verification, and credit-based pricing up to 50% cheaper than alternatives, it's the fastest way to tap into crypto social intelligence.

In this guide, you'll go from zero to your first API call in under 5 minutes.

Step 1: Create Your Account

Head to the signup page and create your account. You'll get 5,000 free credits on the Starter plan — enough to explore the API and test your integration.

What You Get on Starter

1,000 monthly credits
10 requests per minute
Up to 1,000 results per call
Access to all endpoints

Step 2: Generate an API Key

After logging in, navigate to the Dashboard and click Generate Key. Your API key will look like this:

xc_live_a1b2c3d4e5f6g7h8i9j0...

Store this key securely — treat it like a password. Never commit it to version control or expose it in client-side code.

Environment Variables

BASH
# .env
XCROP_API_KEY=xc_live_your_api_key_here

Step 3: Make Your First Request

Let's fetch a Twitter user's profile. Here's how in cURL, JavaScript, and Python:

cURL

BASH
curl -X GET "https://xcrop.io/api/v2/users/elonmusk" \
  -H "Authorization: Bearer xc_live_your_key"

JavaScript

JAVASCRIPT
const response = await fetch("https://xcrop.io/api/v2/users/elonmusk", {
  headers: {
    "Authorization": "Bearer " + process.env.XCROP_API_KEY
  }
});

const result = await response.json();
console.log(result.data.name);      // "Elon Musk"
console.log(result.data.followers);  // 200000000+

Python

PYTHON
import requests
import os

response = requests.get(
    "https://xcrop.io/api/v2/users/elonmusk",
    headers={"Authorization": "Bearer " + os.environ["XCROP_API_KEY"]}
)

user = response.json()["data"]
print(user["name"])       # Elon Musk
print(user["followers"])  # 200000000+

Step 4: Understanding Response Structure

Every XCROP response follows a consistent format:

JSON
{
  "data": { ... },
  "meta": {
    "total": 20,
    "next_cursor": "abc123...",
    "has_next_page": true,
    "latency_ms": 245
  }
}
data — The actual payload (object or array depending on endpoint)
meta.total — Number of results returned
meta.next_cursor — Pagination cursor for fetching the next page
meta.has_next_page — Whether more results are available

Pagination

For list endpoints (tweets, followers, etc.), use the next_cursor to page through results:

PYTHON
import requests
import os

url = "https://xcrop.io/api/v2/users/elonmusk/tweets"
headers = {"Authorization": "Bearer " + os.environ["XCROP_API_KEY"]}
all_tweets = []
cursor = None

for page in range(3):  # Fetch 3 pages
    params = {"count": 20}
    if cursor:
        params["cursor"] = cursor

    response = requests.get(url, headers=headers, params=params)
    result = response.json()

    all_tweets.extend(result["data"])
    cursor = result["meta"].get("next_cursor")

    if not cursor:
        break

print("Total tweets fetched: " + str(len(all_tweets)))

Step 5: Monitor Your Usage

Check your credit consumption in the Dashboard or via response headers:

X-RateLimit-Credits-Remaining — credits left this month
X-RateLimit-Minute-Remaining — requests left in current minute window

Credit Costs at a Glance

EndpointCredits
User profile18 per profile
Tweet / search result15 per result
Follower / following1 per result
Trending topics100 per call (flat)
Write operations100 per operation (flat)
Minimum per call10 credits

Tips for Success

1. Use environment variables — Never hardcode API keys in source code
2. Handle rate limits — Check for 429 status and implement exponential backoff
3. Cache responses — Don't re-fetch data that hasn't changed
4. Use batch endpoints — Look up 100 users or tweets in a single call
5. Try the Endpoints — Test any endpoint interactively before writing code

What's Next?

Now that you're set up, explore these topics:

KOL Tracking — Monitor crypto influencers in real-time
Trending Topics — Spot emerging narratives before they peak
Search — Find any tweet or user with powerful filters
Write API — Automate posting to X/Twitter via your connected account