Public API service for extracting content from TikTok, YouTube, articles, and more
Extract content from various platforms with a simple HTTP API. Perfect for n8n workflows, student projects, and automation.
curl -X POST https://api.prompt-stack.dev/v1/extract/tiktok \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://tiktok.com/@user/video/123456789"}'- ✅ TikTok: Extract video transcripts, metadata, engagement metrics
- ✅ YouTube: Get video transcripts and metadata
- ✅ Articles: Extract clean content from any URL
- ✅ Reddit: Get post content and comments
- ✅ Auto-detect: Smart platform detection from URL
- ✅ n8n Ready: Works out-of-the-box with n8n workflows
- ✅ Rate Limited: Fair usage for all users
- ✅ Well Documented: Auto-generated API docs
| Platform | Endpoint | What You Get |
|---|---|---|
| TikTok | /v1/extract/tiktok |
Transcript, views, likes, comments, shares |
| YouTube | /v1/extract/youtube |
Transcript, metadata, duration |
| Articles | /v1/extract/article |
Clean content, title, author, word count |
/v1/extract/reddit |
Post content, comments, upvotes | |
| Auto-detect | /v1/extract |
Automatically detects platform |
- Docker & Docker Compose
- Git
- Python 3.11+ (for local development)
- Node.js 18+ (for extractors)
# Clone the repository
git clone https://github.com/prompt-stack/extractor-api
cd extractor-api
# Initialize git submodules (extractors)
git submodule update --init --recursive
# Copy environment file
cp .env.example .env
# Edit .env and add your API keys
# API_KEYS=your-key-1,your-key-2,your-key-3
# Run with Docker Compose
docker-compose up --build
# API will be available at http://localhost:8000All endpoints require an API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Auto-detects platform and extracts content:
POST /v1/extract
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"url": "https://tiktok.com/@user/video/123",
"options": {}
}Extract from specific platform:
POST /v1/extract/{platform}
# platforms: tiktok, youtube, article, reddit
{
"url": "https://...",
"options": {}
}{
"success": true,
"platform": "tiktok",
"data": {
"title": "Video title",
"author": "username",
"content": "Transcript...",
"metadata": {
"views": 1000000,
"likes": 50000
}
},
"extracted_at": "2025-10-19T20:00:00Z",
"credits_used": 1
}Visit these URLs when running:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
curl -X POST http://localhost:8000/v1/extract/tiktok \
-H "Authorization: Bearer demo-key-123" \
-H "Content-Type: application/json" \
-d '{"url": "https://tiktok.com/@user/video/123"}'import requests
API_KEY = "your-api-key"
API_URL = "https://api.prompt-stack.dev/v1/extract"
def extract_content(url):
response = requests.post(
API_URL,
headers={"Authorization": f"Bearer {API_KEY}"},
json={"url": url}
)
return response.json()
# Extract from any platform
result = extract_content("https://tiktok.com/@user/video/123")
print(result["data"])const API_KEY = 'your-api-key';
const API_URL = 'https://api.prompt-stack.dev/v1/extract';
async function extractContent(url) {
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
});
return response.json();
}
// Usage
const result = await extractContent('https://tiktok.com/@user/video/123');
console.log(result.data);- Add HTTP Request node
- Configure:
- Method: POST
- URL:
https://api.prompt-stack.dev/v1/extract/tiktok - Authentication: Generic Credential Type
- Header Auth
- Name: Authorization
- Value:
Bearer YOUR_API_KEY
- Body: JSON
{ "url": "{{$json.tiktok_url}}" }
# Install Python dependencies
cd gateway
pip install -r requirements.txt
# Setup extractors (git submodules)
cd ..
git submodule update --init --recursive
# Install extractor dependencies
cd extractors/tiktok && npm install
cd ../article && npm install
# Run the API
cd ../../gateway
python main.pyAPI runs at http://localhost:8000
extractor-api/
├── gateway/ # FastAPI gateway
│ ├── main.py # Main application
│ ├── auth/ # Authentication
│ ├── routers/ # API routes
│ └── requirements.txt # Python deps
├── extractors/ # Git submodules
│ ├── tiktok/ → github.com/prompt-stack/tiktok-extractor
│ ├── article/ → github.com/prompt-stack/article-extractor
│ └── youtube/ → github.com/prompt-stack/youtube-extractor
├── docs/ # Documentation
├── Dockerfile
├── docker-compose.yml
└── README.md
# Install Railway CLI
npm install -g @railway/cli
# Login
railway login
# Create new project
railway init
# Set environment variables
railway variables set API_KEYS="key1,key2,key3"
# Deploy
railway up
# Get public URL
railway domain# Install flyctl
curl -L https://fly.io/install.sh | sh
# Login
fly auth login
# Launch app
fly launch
# Set secrets
fly secrets set API_KEYS="key1,key2,key3"
# Deploy
fly deploy| Variable | Description | Default |
|---|---|---|
API_KEYS |
Comma-separated API keys | demo-key-123 |
PORT |
Server port | 8000 |
Edit .env file:
API_KEYS=student-key-1,student-key-2,instructor-keyFor production, use secure key generation:
python -c "import secrets; print(secrets.token_urlsafe(32))"Currently no rate limiting (development mode). For production, add middleware for:
- Requests per minute per API key
- Concurrent request limits
- Monthly quota
{
"detail": "Error message",
"platform": "tiktok",
"url": "https://..."
}| Status Code | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 400 | Invalid request (malformed URL, etc.) |
| 404 | Platform not supported |
| 500 | Extraction failed |
| 504 | Extraction timeout (>60s) |
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
MIT License - see LICENSE file for details
- content-engine - Full-stack content management system
- tiktok-extractor - Standalone TikTok extractor
- article-extractor - Standalone article extractor
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ for students and developers