Complete examples for the Free Crypto News API in Python, JavaScript, Go, and cURL. All endpoints are 100% free — no API keys required.
Looking for something specific?
| I want to... | Jump to |
|---|---|
| Make my first API call | Quick Start |
| Fetch & filter news | News Endpoints |
| Use AI features | AI Endpoints |
| Get market/trading data | Market Data |
| Stream real-time updates | Real-time Streaming |
| See platform-specific examples | Platform Examples |
| Use an SDK instead | SDKs |
# Python — just use the built-in requests library
pip install requests
# JavaScript/Node.js — fetch is built-in since Node 18+
# No installation needed!
# Go — standard library is enough
# Or use the SDK: go get github.com/nirholas/free-crypto-news/sdk/goPython
import requests
response = requests.get("https://cryptocurrency.cv/api/news?limit=5")
response.raise_for_status() # Raise an error for bad status codes
news = response.json()
for article in news.get("articles", [])[:5]:
print(f"📰 {article['title']}")
print(f" Source: {article['source']} | Sentiment: {article.get('sentiment', 'N/A')}")
print()Expected output:
📰 Bitcoin Surges Past $95K as Institutional Demand Grows
Source: CoinDesk | Sentiment: positive
📰 Ethereum Layer 2 TVL Hits New Record
Source: The Block | Sentiment: positive
...
JavaScript
try {
const response = await fetch("https://cryptocurrency.cv/api/news?limit=5");
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const news = await response.json();
news.articles.forEach(article => {
console.log(`📰 ${article.title} (${article.source})`);
});
} catch (error) {
console.error('Failed to fetch news:', error.message);
}Go
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
)
type NewsResponse struct {
Articles []struct {
Title string `json:"title"`
Source string `json:"source"`
} `json:"articles"`
}
func main() {
resp, err := http.Get("https://cryptocurrency.cv/api/news?limit=5")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var news NewsResponse
json.Unmarshal(body, &news)
for _, a := range news.Articles {
fmt.Printf("📰 %s (%s)\n", a.Title, a.Source)
}
}cURL
# Pretty-printed output
curl -s "https://cryptocurrency.cv/api/news?limit=5" | python3 -m json.tool
# Or with jq
curl -s "https://cryptocurrency.cv/api/news?limit=5" | jq '.articles[] | .title'Python Example
import requests
# Basic fetch
response = requests.get("https://cryptocurrency.cv/api/news", params={
"limit": 20
})
news = response.json()
# With filters
response = requests.get("https://cryptocurrency.cv/api/news", params={
"limit": 50,
"category": "bitcoin",
"source": "coindesk"
})
filtered_news = response.json()JavaScript Example
// Basic fetch
const response = await fetch("https://cryptocurrency.cv/api/news?limit=20");
const news = await response.json();
// With filters
const filtered = await fetch(
"https://cryptocurrency.cv/api/news?limit=50&category=bitcoin&source=coindesk"
);
const filteredNews = await filtered.json();cURL Example
# Basic fetch
curl "https://cryptocurrency.cv/api/news?limit=20"
# With filters
curl "https://cryptocurrency.cv/api/news?limit=50&category=bitcoin&source=coindesk"Python Example
import requests
# Korean news, translated
response = requests.get("https://cryptocurrency.cv/api/news/international", params={
"lang": "ko",
"translate": "true"
})
korean_news = response.json()
# Japanese news, original
response = requests.get("https://cryptocurrency.cv/api/news/international", params={
"lang": "ja",
"translate": "false"
})
japanese_news = response.json()Python Example
import requests
response = requests.post(
"https://cryptocurrency.cv/api/news/extract",
json={"url": "https://example.com/article"},
headers={"Content-Type": "application/json"}
)
article = response.json()
print(f"Title: {article['title']}")
print(f"Content: {article['content'][:500]}...")response = requests.get("https://cryptocurrency.cv/api/bitcoin?limit=20")
btc_news = response.json()response = requests.get("https://cryptocurrency.cv/api/defi?limit=20")
defi_news = response.json()response = requests.get("https://cryptocurrency.cv/api/breaking")
breaking = response.json()response = requests.get("https://cryptocurrency.cv/api/search", params={
"q": "Ethereum ETF",
"limit": 50,
"from": "2024-01-01",
"to": "2024-06-30"
})
results = response.json()response = requests.get("https://cryptocurrency.cv/api/trending?limit=10")
trending = response.json()response = requests.get("https://cryptocurrency.cv/api/digest")
digest = response.json()Python Example
import requests
# Get BTC sentiment
response = requests.get("https://cryptocurrency.cv/api/sentiment", params={
"asset": "BTC",
"limit": 50
})
sentiment = response.json()
print(f"Score: {sentiment['score']}")
print(f"Label: {sentiment['label']}") # bullish, bearish, neutral
print(f"Positive: {sentiment['positive']}")
print(f"Negative: {sentiment['negative']}")response = requests.get("https://cryptocurrency.cv/api/summarize", params={
"url": "https://example.com/long-article"
})
summary = response.json()
print(summary['summary'])response = requests.get("https://cryptocurrency.cv/api/ask", params={
"q": "What is the current Bitcoin market sentiment?",
"context": "Include recent news analysis"
})
answer = response.json()
print(answer['response'])response = requests.get("https://cryptocurrency.cv/api/ai/brief")
brief = response.json()
print(brief['summary'])response = requests.post(
"https://cryptocurrency.cv/api/ai/debate",
json={"topic": "Bitcoin will reach $100k by end of year"},
headers={"Content-Type": "application/json"}
)
debate = response.json()
print(f"Bull Case: {debate['bull']}")
print(f"Bear Case: {debate['bear']}")response = requests.get("https://cryptocurrency.cv/api/ai/oracle", params={
"asset": "BTC"
})
prediction = response.json()response = requests.get("https://cryptocurrency.cv/api/entities", params={
"text": "Vitalik Buterin announced Ethereum's next upgrade at ETHDenver"
})
entities = response.json()
# Returns: {people: ["Vitalik Buterin"], organizations: ["Ethereum"], events: ["ETHDenver"]}response = requests.get("https://cryptocurrency.cv/api/narratives?limit=10")
narratives = response.json()response = requests.get("https://cryptocurrency.cv/api/clickbait", params={
"title": "You WON'T BELIEVE what Bitcoin just did!!!"
})
result = response.json()
print(f"Clickbait Score: {result['score']}") # 0-1response = requests.get("https://cryptocurrency.cv/api/factcheck", params={
"claim": "Bitcoin uses more energy than Argentina"
})
check = response.json()response = requests.post(
"https://cryptocurrency.cv/api/detect/ai-content",
json={"text": "Your text to analyze..."},
headers={"Content-Type": "application/json"}
)
result = response.json()
print(f"AI Probability: {result['probability']}")response = requests.get("https://cryptocurrency.cv/api/market/coins", params={
"limit": 100,
"page": 1,
"order": "market_cap_desc"
})
coins = response.json()response = requests.get("https://cryptocurrency.cv/api/market/ohlc/bitcoin", params={
"days": 30
})
ohlc = response.json()
# Returns: [[timestamp, open, high, low, close], ...]response = requests.get("https://cryptocurrency.cv/api/market/history/ethereum", params={
"days": 90
})
history = response.json()response = requests.get("https://cryptocurrency.cv/api/market/exchanges?limit=50")
exchanges = response.json()response = requests.get("https://cryptocurrency.cv/api/market/compare", params={
"coins": "bitcoin,ethereum,solana"
})
comparison = response.json()response = requests.get("https://cryptocurrency.cv/api/fear-greed")
fg = response.json()
print(f"Value: {fg['value']} ({fg['classification']})")response = requests.get("https://cryptocurrency.cv/api/arbitrage", params={
"min_spread": 0.5,
"limit": 20
})
opportunities = response.json()
for opp in opportunities:
print(f"{opp['symbol']}: Buy on {opp['buy_exchange']} at {opp['buy_price']}")
print(f" Sell on {opp['sell_exchange']} at {opp['sell_price']}")
print(f" Spread: {opp['spread']}%")response = requests.get("https://cryptocurrency.cv/api/signals", params={
"asset": "BTC",
"timeframe": "4h"
})
signals = response.json()response = requests.get("https://cryptocurrency.cv/api/funding")
funding = response.json()response = requests.get("https://cryptocurrency.cv/api/options?asset=BTC")
options = response.json()response = requests.get("https://cryptocurrency.cv/api/liquidations", params={
"timeframe": "24h",
"min_value": 500000
})
liquidations = response.json()response = requests.get("https://cryptocurrency.cv/api/whale-alerts", params={
"min_value": 5000000,
"limit": 20
})
whales = response.json()response = requests.get("https://cryptocurrency.cv/api/orderbook", params={
"symbol": "BTCUSDT",
"exchange": "binance",
"depth": 20
})
orderbook = response.json()response = requests.get("https://cryptocurrency.cv/api/social/x", params={
"asset": "BTC",
"limit": 20
})
tweets = response.json()response = requests.get("https://cryptocurrency.cv/api/social/reddit", params={
"subreddit": "cryptocurrency",
"limit": 20
})
posts = response.json()response = requests.get("https://cryptocurrency.cv/api/social/youtube?limit=20")
videos = response.json()response = requests.get("https://cryptocurrency.cv/api/social/influencers?limit=50")
influencers = response.json()response = requests.get("https://cryptocurrency.cv/api/governance", params={
"protocol": "aave",
"limit": 20
})
proposals = response.json()response = requests.get("https://cryptocurrency.cv/api/events", params={
"type": "conference",
"limit": 20
})
events = response.json()response = requests.get("https://cryptocurrency.cv/api/nft?limit=20")
nft_news = response.json()response = requests.get("https://cryptocurrency.cv/api/onchain", params={
"chain": "ethereum",
"metric": "transactions"
})
onchain = response.json()response = requests.get("https://cryptocurrency.cv/api/onchain/gas?chain=ethereum")
gas = response.json()
print(f"Fast: {gas['fast']} gwei")
print(f"Standard: {gas['standard']} gwei")
print(f"Slow: {gas['slow']} gwei")response = requests.get("https://cryptocurrency.cv/api/onchain/defi")
tvl = response.json()response = requests.get("https://cryptocurrency.cv/api/staking?asset=ETH")
staking = response.json()response = requests.get("https://cryptocurrency.cv/api/layer2")
l2 = response.json()response = requests.get("https://cryptocurrency.cv/api/yields", params={
"chain": "ethereum",
"min_apy": 10
})
yields = response.json()response = requests.get("https://cryptocurrency.cv/api/airdrops?status=active")
airdrops = response.json()response = requests.get("https://cryptocurrency.cv/api/security", params={
"severity": "high",
"limit": 20
})
alerts = response.json()response = requests.get("https://cryptocurrency.cv/api/hacks?limit=20")
hacks = response.json()response = requests.get("https://cryptocurrency.cv/api/regulatory", params={
"region": "us",
"limit": 20
})
regulatory = response.json()response = requests.get("https://cryptocurrency.cv/api/regulatory/etf?type=bitcoin")
etf = response.json()response = requests.get("https://cryptocurrency.cv/api/regulatory/sec?limit=20")
sec = response.json()response = requests.get("https://cryptocurrency.cv/api/regulatory/enforcement?limit=20")
enforcement = response.json()response = requests.get("https://cryptocurrency.cv/api/regulatory/cbdc")
cbdc = response.json()curl "https://cryptocurrency.cv/api/rss?category=bitcoin&limit=50"response = requests.get("https://cryptocurrency.cv/api/rss.json?limit=50")
feed = response.json()response = requests.get("https://cryptocurrency.cv/api/export/csv?limit=100")
csv_data = response.text
# Save to file
with open("crypto_news.csv", "w") as f:
f.write(csv_data)response = requests.get("https://cryptocurrency.cv/api/export/json", params={
"limit": 100,
"pretty": "true"
})
json_data = response.json()curl "https://cryptocurrency.cv/api/llms.txt"response = requests.get("https://cryptocurrency.cv/api/archive", params={
"year": 2024,
"month": 6
})
archive = response.json()response = requests.get("https://cryptocurrency.cv/api/analytics/overview")
overview = response.json()response = requests.get("https://cryptocurrency.cv/api/analytics/trends", params={
"period": "7d",
"category": "bitcoin"
})
trends = response.json()response = requests.get("https://cryptocurrency.cv/api/credibility")
credibility = response.json()response = requests.get("https://cryptocurrency.cv/api/impact?period=24h")
impact = response.json()response = requests.get("https://cryptocurrency.cv/api/correlations", params={
"asset": "BTC",
"period": "30d"
})
correlations = response.json()These endpoints require an API key:
headers = {"X-API-Key": "your-api-key"}# Get portfolio
response = requests.get(
"https://cryptocurrency.cv/api/portfolio",
headers=headers
)
# Add holding
response = requests.post(
"https://cryptocurrency.cv/api/portfolio/add",
headers={**headers, "Content-Type": "application/json"},
json={"symbol": "BTC", "amount": 0.5, "price": 45000}
)# Create price alert
response = requests.post(
"https://cryptocurrency.cv/api/alerts",
headers={**headers, "Content-Type": "application/json"},
json={
"type": "price",
"asset": "BTC",
"condition": "above",
"value": 100000,
"notification": "email"
}
)
# Get alerts
response = requests.get(
"https://cryptocurrency.cv/api/alerts",
headers=headers
)# Add to watchlist
response = requests.post(
"https://cryptocurrency.cv/api/watchlist",
headers={**headers, "Content-Type": "application/json"},
json={"symbol": "SOL"}
)
# Get watchlist
response = requests.get(
"https://cryptocurrency.cv/api/watchlist",
headers=headers
)const ws = new WebSocket('wss://cryptocurrency.cv/api/stream/news');
ws.onmessage = (event) => {
const article = JSON.parse(event.data);
console.log(`📰 ${article.title}`);
};
// Subscribe to categories
ws.send(JSON.stringify({
type: 'subscribe',
categories: ['bitcoin', 'ethereum']
}));const es = new EventSource('https://cryptocurrency.cv/api/sse/news?category=bitcoin');
es.onmessage = (event) => {
const article = JSON.parse(event.data);
console.log(`📰 ${article.title}`);
};const ws = new WebSocket('wss://cryptocurrency.cv/api/stream/market');
ws.send(JSON.stringify({
type: 'subscribe',
symbols: ['BTC', 'ETH', 'SOL']
}));
ws.onmessage = (event) => {
const tick = JSON.parse(event.data);
console.log(`${tick.symbol}: $${tick.price}`);
};All examples are available as runnable files:
| Language | Directory | Files |
|---|---|---|
| Python | examples/python/ |
news.py, ai.py, market.py, trading.py, social.py, blockchain.py, regulatory.py, analytics.py, portfolio.py, premium.py, feeds.py |
| JavaScript | examples/javascript/ |
news.js, ai.js, market.js, trading.js, streaming.js |
| Go | examples/go/ |
client.go |
| cURL | examples/curl/ |
all-endpoints.sh |
# Python
cd examples/python
python news.py
python ai.py
python market.py
# JavaScript
cd examples/javascript
node news.js
node ai.js
# Go
cd examples/go
go run client.go
# cURL
cd examples/curl
chmod +x all-endpoints.sh
./all-endpoints.shOfficial SDKs for quick integration:
| SDK | Install | Docs |
|---|---|---|
| Python | pip install free-crypto-news |
Python SDK |
| JavaScript | npm install free-crypto-news |
JS SDK |
| TypeScript | Full type definitions included | TS SDK |
| React | npm install @free-crypto-news/react |
React SDK |
| Go | go get github.com/nirholas/free-crypto-news/sdk/go |
Go SDK |
| PHP | Composer package | PHP SDK |
| Ruby | Gem package | Ruby SDK |
| Rust | Cargo crate | Rust SDK |
Full platform-specific tutorials with working code:
| Platform | Guide |
|---|---|
| Discord Bot | Build a Discord news bot → |
| Slack Bot | Build a Slack news bot → |
| Telegram Bot | Build a Telegram news bot → |
| LangChain | Use with LangChain agents → |
| React App | Build a React news app → |
| Rust | Rust integration → |
| C# | C# integration → |
| Kotlin | Kotlin integration → |
| Swift | Swift integration → |
| AI Platforms | AI platform integrations → |
Always handle errors gracefully in production code:
import requests
from time import sleep
def fetch_news(retries=3):
for attempt in range(retries):
try:
response = requests.get("https://cryptocurrency.cv/api/news?limit=10", timeout=10)
response.raise_for_status()
return response.json()
except requests.exceptions.HTTPError as e:
if e.response.status_code == 429: # Rate limited
wait = 2 ** attempt
print(f"Rate limited, retrying in {wait}s...")
sleep(wait)
else:
raise
except requests.exceptions.ConnectionError:
print("Connection error, retrying...")
sleep(1)
raise Exception("Failed after retries")async function fetchNews(retries = 3) {
for (let attempt = 0; attempt < retries; attempt++) {
try {
const response = await fetch('https://cryptocurrency.cv/api/news?limit=10');
if (response.status === 429) {
const wait = Math.pow(2, attempt) * 1000;
console.log(`Rate limited, retrying in ${wait}ms...`);
await new Promise(r => setTimeout(r, wait));
continue;
}
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (error) {
if (attempt === retries - 1) throw error;
console.log('Retrying...', error.message);
}
}
}