A Python toolkit for keyword research using the DataForSEO API, designed to work seamlessly with Claude Code.
- 25+ API functions across Keywords Data, Labs, SERP, and Trends APIs
- Auto-saves results as timestamped JSON files for easy reference
- Claude Code integration for AI-assisted keyword research
- Programmatic access for custom scripts and automation
git clone https://github.com/yourusername/dataforseo-keyword-toolkit.git
cd dataforseo-keyword-toolkitpip install -r requirements.txtcp .env.example .envEdit .env with your DataForSEO credentials (get them from app.dataforseo.com/api-access):
DATAFORSEO_LOGIN=your_email@example.com
DATAFORSEO_PASSWORD=your_api_password
With Claude Code:
"Research keywords for AI website builders"
"Get YouTube keyword data for my video idea"
"Analyze competitor example.com"
Programmatically:
from main import keyword_research, youtube_keyword_research
# Full keyword analysis
results = keyword_research("AI website builders")
# YouTube-focused research
results = youtube_keyword_research("how to build a website")Just describe what you want to research:
| Request | What it does |
|---|---|
| "Research keywords for [topic]" | Full keyword analysis with suggestions |
| "Get YouTube keyword data for [video idea]" | YouTube-focused research |
| "Find keyword suggestions for [seed]" | Long-tail variations |
| "Analyze competitor [domain.com]" | Competitor keyword intel |
| "What's trending in [category]" | Current trends data |
| Function | Purpose |
|---|---|
keyword_research(keyword) |
Full keyword analysis |
youtube_keyword_research(keyword) |
YouTube-focused research |
landing_page_keyword_research(keywords, competitor) |
SEO optimization |
full_keyword_analysis(keywords) |
Comprehensive analysis |
competitor_analysis(domain) |
Competitor keyword intel |
trending_topics() |
Currently trending searches |
| Function | Purpose | Limit |
|---|---|---|
get_search_volume(keywords) |
Volume, CPC, competition | 700 |
get_keywords_for_site(domain) |
Keywords for a domain | - |
get_keywords_for_keywords(keywords) |
Keyword expansion | 20 |
get_ad_traffic_by_keywords(keywords) |
Traffic estimates | - |
| Function | Purpose | Limit |
|---|---|---|
get_keyword_overview(keywords) |
Comprehensive metrics | 700 |
get_keyword_suggestions(keyword) |
Long-tail variations | 1 seed |
get_keyword_ideas(keywords) |
Category expansion | 200 |
get_related_keywords(keyword) |
"Searches related to" | 1 seed |
get_bulk_keyword_difficulty(keywords) |
Difficulty scores | 1000 |
get_historical_search_volume(keywords) |
Monthly trends | 700 |
get_search_intent(keywords) |
Intent classification | 1000 |
get_domain_keywords(domain) |
Domain rankings | - |
get_competitors(keywords) |
Find competitors | - |
| Function | Purpose |
|---|---|
get_google_serp(keyword) |
Google organic results |
get_youtube_serp(keyword) |
YouTube video rankings |
get_google_maps_serp(keyword) |
Local results |
get_google_news_serp(keyword) |
News results |
get_google_images_serp(keyword) |
Image results |
get_featured_snippet(keyword) |
Featured snippet data |
| Function | Purpose |
|---|---|
get_trends_explore(keywords) |
Full trend data |
get_youtube_trends(keywords) |
YouTube trends |
get_news_trends(keywords) |
News trends |
get_shopping_trends(keywords) |
Shopping trends |
compare_keyword_trends(keywords) |
Compare trends |
get_trending_now() |
Currently trending |
├── .env.example # Template for API credentials
├── main.py # High-level convenience functions
├── requirements.txt # Python dependencies
├── CLAUDE.md # Instructions for Claude Code
├── config/
│ └── settings.py # Configuration and defaults
├── core/
│ ├── client.py # DataForSEO API client (singleton)
│ └── storage.py # Auto-save results to JSON
├── api/
│ ├── keywords_data.py # Search volume, CPC, competition
│ ├── labs.py # Suggestions, difficulty, intent
│ ├── serp.py # Google/YouTube rankings
│ └── trends.py # Google Trends data
└── results/ # Auto-generated output (gitignored)
├── keywords_data/
├── labs/
├── serp/
├── trends/
└── summary/
All API responses are automatically saved as timestamped JSON files:
results/labs/20251204_092522__keyword_suggestions__AI_website_builders__limit_30.json
Each file includes metadata and the full API response for later reference.
- Python 3.8+
- DataForSEO API account (sign up)
MIT License - see LICENSE for details.