To integrate Replit with Ubersuggest, subscribe to an Ubersuggest plan with API access, get your API key from app.neilpatel.com, store it in Replit Secrets (lock icon 🔒), and use Python or Node.js to fetch keyword suggestions, traffic estimates, and SEO difficulty scores. Deploy on Autoscale for on-demand keyword research queries.
Why Connect Replit to the Ubersuggest API?
Ubersuggest is one of the most accessible SEO tools available, offering keyword suggestions, search volume data, CPC estimates, and SEO difficulty scores at a price significantly below enterprise SEO platforms. The Ubersuggest API enables programmatic access to this data, making it useful for building automated keyword research tools, content ideation pipelines, and SEO reporting dashboards.
The API covers keyword data (suggestions, volume, CPC, difficulty), domain data (organic keywords, traffic, domain score), and content ideas (top-performing content for a keyword). The keyword difficulty score helps content teams prioritize which keywords to target based on competition level.
Ubersuggest API access requires a paid subscription. Store the API key in Replit Secrets and proxy all API calls through your Replit backend to prevent key exposure in browser requests.
Integration method
You connect Replit to Ubersuggest by subscribing to an Ubersuggest plan that includes API access, obtaining your API key from the app dashboard, and storing it in Replit Secrets. Your server-side Python or Node.js code sends GET requests to the Ubersuggest API with the key passed as a query parameter or header, returning keyword suggestions, search volume data, CPC estimates, and SEO difficulty scores for any keyword or domain.
Prerequisites
- A Replit account with a Python or Node.js project created
- An Ubersuggest paid subscription (Individual plan or higher) at https://app.neilpatel.com
- An API key from your Ubersuggest account settings
- Basic understanding of SEO concepts (search volume, keyword difficulty, CPC)
- Familiarity with HTTP GET requests in Python (requests library) or Node.js (axios)
Step-by-step guide
Get Your Ubersuggest API Key
Get Your Ubersuggest API Key
Go to https://app.neilpatel.com and log into your Ubersuggest account. Navigate to Profile > Manage Account or Settings, and look for the API section. Your API key is displayed there for paid plan subscribers. Ubersuggest offers individual, business, and enterprise plans. API access is included with paid plans — free accounts have limited web UI access and no API access. The individual plan is the entry-level paid option and includes API access with rate limits appropriate for single-user or small-team use. The Ubersuggest API base URL is https://app.neilpatel.com/api/v2/. Available endpoints include /keywords/suggestions (keyword suggestions for a seed keyword), /keywords/overview (detailed stats for a specific keyword), /traffic/url (domain traffic overview), and /traffic/keywords (top organic keywords for a domain). Some endpoints may require specific plan tiers for full data access. Note that Ubersuggest occasionally updates their API structure. Always check the current API documentation in your account dashboard for the latest endpoint URLs and parameter names, as these may differ slightly from what is documented in third-party tutorials.
Pro tip: Ubersuggest's API documentation is available in your account dashboard after subscribing. Check the docs page for the latest endpoint URLs before building your integration.
Expected result: You have an Ubersuggest API key from your paid account settings.
Store the API Key in Replit Secrets
Store the API Key in Replit Secrets
Click the lock icon 🔒 in the Replit sidebar to open the Secrets pane. Add a new secret: - Key: UBERSUGGEST_API_KEY - Value: your Ubersuggest API key Click 'Add Secret' to save. Access the key in Python with os.environ['UBERSUGGEST_API_KEY'] and in Node.js with process.env.UBERSUGGEST_API_KEY. Ubersuggest API keys are tied to your account's subscription and have rate limits. Exposing the key in client-side JavaScript could allow external parties to consume your API quota without your knowledge. Always proxy Ubersuggest API calls through your Replit backend and never include the key in browser-facing responses.
Pro tip: After adding the secret, restart your Repl to ensure the environment variable is loaded into the running process.
Expected result: UBERSUGGEST_API_KEY appears in the Replit Secrets pane with the value hidden.
Build a Keyword Research Server in Python
Build a Keyword Research Server in Python
Install requests and Flask with 'pip install requests flask'. Ubersuggest API requests pass the API key in the 'Authorization' header as a Bearer token on some endpoints, or as a query parameter. Check your specific API documentation for the correct authentication format — the server below uses the Authorization Bearer pattern common to current Ubersuggest API versions. The Flask server below provides endpoints for keyword suggestions, keyword overview stats, and domain traffic data. Each endpoint accepts simple query parameters and forwards cleaned responses to the client. The server never exposes the raw API key in its responses.
1import os2import requests3from flask import Flask, request, jsonify45app = Flask(__name__)67UBERSUGGEST_API_KEY = os.environ["UBERSUGGEST_API_KEY"]8BASE_URL = "https://app.neilpatel.com/api/v2"910HEADERS = {11 "Authorization": f"Bearer {UBERSUGGEST_API_KEY}",12 "Content-Type": "application/json",13 "Accept": "application/json"14}151617def ubersuggest_get(endpoint: str, params: dict) -> dict:18 """Make a GET request to the Ubersuggest API."""19 resp = requests.get(f"{BASE_URL}{endpoint}", params=params, headers=HEADERS)20 resp.raise_for_status()21 return resp.json()222324@app.route("/keyword-suggestions")25def keyword_suggestions():26 """27 Get keyword suggestions for a seed keyword.28 Params: keyword, country (default 'us'), language (default 'en')29 """30 keyword = request.args.get("keyword")31 country = request.args.get("country", "us")32 language = request.args.get("language", "en")3334 if not keyword:35 return jsonify({"error": "keyword parameter required"}), 4003637 try:38 data = ubersuggest_get("/keywords/suggestions", {39 "keyword": keyword,40 "country": country,41 "language": language42 })43 return jsonify(data)44 except requests.HTTPError as e:45 return jsonify({"error": str(e)}), e.response.status_code if e.response else 500464748@app.route("/keyword-overview")49def keyword_overview():50 """51 Get detailed stats for a specific keyword.52 Params: keyword, country, language53 """54 keyword = request.args.get("keyword")55 country = request.args.get("country", "us")56 language = request.args.get("language", "en")5758 if not keyword:59 return jsonify({"error": "keyword parameter required"}), 4006061 try:62 data = ubersuggest_get("/keywords/overview", {63 "keyword": keyword,64 "country": country,65 "language": language66 })67 return jsonify(data)68 except requests.HTTPError as e:69 return jsonify({"error": str(e)}), e.response.status_code if e.response else 500707172@app.route("/domain-keywords")73def domain_keywords():74 """75 Get top organic keywords for a domain.76 Params: domain, country77 """78 domain = request.args.get("domain")79 country = request.args.get("country", "us")8081 if not domain:82 return jsonify({"error": "domain parameter required"}), 4008384 try:85 data = ubersuggest_get("/traffic/keywords", {86 "url": domain,87 "country": country88 })89 return jsonify(data)90 except requests.HTTPError as e:91 return jsonify({"error": str(e)}), e.response.status_code if e.response else 500929394@app.route("/content-ideas")95def content_ideas():96 """97 Get top-performing content for a keyword.98 Params: keyword, country99 """100 keyword = request.args.get("keyword")101 country = request.args.get("country", "us")102103 if not keyword:104 return jsonify({"error": "keyword parameter required"}), 400105106 try:107 data = ubersuggest_get("/content/ideas", {108 "keyword": keyword,109 "country": country110 })111 return jsonify(data)112 except requests.HTTPError as e:113 return jsonify({"error": str(e)}), e.response.status_code if e.response else 500114115116if __name__ == "__main__":117 app.run(host="0.0.0.0", port=3000, debug=True)Pro tip: The 'country' parameter uses ISO 3166-1 alpha-2 codes (us, gb, au, ca) and the 'language' parameter uses ISO 639-1 codes (en, es, fr). Always pass these to get location-specific search volume data.
Expected result: GET /keyword-suggestions?keyword=content+marketing returns a JSON object with keyword suggestions, search volumes, difficulty scores, and CPC data.
Build a Node.js Ubersuggest Server
Build a Node.js Ubersuggest Server
Install dependencies with 'npm install express axios'. The Node.js version mirrors the Python server with the same endpoints and error handling pattern. The server uses axios for HTTP requests and returns consistent JSON responses. The example below adds a /keyword-filter endpoint that queries keyword suggestions and filters results by maximum difficulty score and minimum search volume — useful for finding low-competition, high-volume keyword opportunities automatically without manual sorting.
1const express = require('express');2const axios = require('axios');34const app = express();5app.use(express.json());67const UBERSUGGEST_API_KEY = process.env.UBERSUGGEST_API_KEY;8const BASE_URL = 'https://app.neilpatel.com/api/v2';910const HEADERS = {11 Authorization: `Bearer ${UBERSUGGEST_API_KEY}`,12 'Content-Type': 'application/json',13 Accept: 'application/json'14};1516async function ubersuggestGet(endpoint, params = {}) {17 const { data } = await axios.get(`${BASE_URL}${endpoint}`, { params, headers: HEADERS });18 return data;19}2021// Keyword suggestions22app.get('/keyword-suggestions', async (req, res) => {23 const { keyword, country = 'us', language = 'en' } = req.query;24 if (!keyword) return res.status(400).json({ error: 'keyword parameter required' });25 try {26 const data = await ubersuggestGet('/keywords/suggestions', { keyword, country, language });27 res.json(data);28 } catch (err) {29 res.status(err.response?.status || 500).json({ error: err.response?.data || err.message });30 }31});3233// Keyword overview with full stats34app.get('/keyword-overview', async (req, res) => {35 const { keyword, country = 'us', language = 'en' } = req.query;36 if (!keyword) return res.status(400).json({ error: 'keyword parameter required' });37 try {38 const data = await ubersuggestGet('/keywords/overview', { keyword, country, language });39 res.json(data);40 } catch (err) {41 res.status(err.response?.status || 500).json({ error: err.response?.data || err.message });42 }43});4445// Filter keywords by difficulty and min volume46app.get('/keyword-filter', async (req, res) => {47 const {48 keyword,49 country = 'us',50 language = 'en',51 max_difficulty = 50,52 min_volume = 10053 } = req.query;5455 if (!keyword) return res.status(400).json({ error: 'keyword parameter required' });5657 try {58 const data = await ubersuggestGet('/keywords/suggestions', { keyword, country, language });59 const suggestions = data.suggestions || data.keywords || [];6061 const filtered = suggestions62 .filter(k => (63 (k.sd || k.difficulty || 0) <= Number(max_difficulty) &&64 (k.sv || k.search_volume || 0) >= Number(min_volume)65 ))66 .sort((a, b) => (b.sv || b.search_volume || 0) - (a.sv || a.search_volume || 0));6768 res.json({69 seed_keyword: keyword,70 total_filtered: filtered.length,71 keywords: filtered.slice(0, 50)72 });73 } catch (err) {74 res.status(err.response?.status || 500).json({ error: err.response?.data || err.message });75 }76});7778// Domain keywords79app.get('/domain-keywords', async (req, res) => {80 const { domain, country = 'us' } = req.query;81 if (!domain) return res.status(400).json({ error: 'domain parameter required' });82 try {83 const data = await ubersuggestGet('/traffic/keywords', { url: domain, country });84 res.json(data);85 } catch (err) {86 res.status(err.response?.status || 500).json({ error: err.response?.data || err.message });87 }88});8990app.listen(3000, '0.0.0.0', () => {91 console.log('Ubersuggest integration server running on port 3000');92});Pro tip: The field names in Ubersuggest API responses may vary (sv vs search_volume, sd vs difficulty) depending on the endpoint. Use optional chaining or fallbacks to handle both naming conventions.
Expected result: GET /keyword-filter?keyword=seo+tools&max_difficulty=40&min_volume=500 returns a filtered list of keyword opportunities sorted by search volume.
Deploy and Configure Rate Limit Handling
Deploy and Configure Rate Limit Handling
Click the Deploy button in Replit and choose Autoscale deployment. Keyword research APIs are request-driven workloads with no persistent background state, making Autoscale the most efficient deployment type. Your server scales to zero when idle and responds within seconds when queries come in. Implement response caching for repeated keyword queries to stay within Ubersuggest rate limits. Keyword data does not change hour-to-hour, so caching results for several hours is appropriate. For a simple in-memory cache, use a Python dictionary or a Node.js Map with timestamp-based expiry. For more durable caching across Replit restarts, use a database or key-value store. Update your .replit configuration file with the correct run command. After deployment, test the endpoint with a few keyword queries to confirm the API key is being read correctly from Secrets in the production environment.
1[[ports]]2internalPort = 30003externalPort = 8045[deployment]6run = ["node", "server.js"]7deploymentTarget = "cloudrun"Pro tip: Cache keyword suggestion results for at least 4 hours — search volume data updates monthly at most, so repeated queries for the same keyword within a day return identical results and waste API quota.
Expected result: Your deployed Replit app serves Ubersuggest keyword data at the production URL with the API key securely stored in Secrets.
Common use cases
Automated Keyword Research Pipeline
A Replit backend accepts a seed keyword from a content team's internal tool, queries Ubersuggest for up to 100 keyword suggestions sorted by search volume, filters results by a maximum SEO difficulty score, and returns a prioritized list of low-competition, high-volume keyword opportunities. This automates the manual keyword research process that content teams repeat for every new content topic.
Build a Flask endpoint that accepts a seed keyword and a maximum difficulty score, queries Ubersuggest for keyword suggestions, filters by the difficulty threshold, and returns the top 20 opportunities sorted by search volume descending.
Copy this prompt to try it in Replit
Competitor Keyword Gap Analysis
A Replit script accepts two domain names and queries Ubersuggest for the top 50 organic keywords for each. It then identifies keywords that the competitor ranks for but the client's domain does not, sorted by the competitor's estimated monthly traffic for each keyword. This gap analysis reveals quick-win content opportunities.
Create a Python script that queries Ubersuggest for the organic keywords of two domains, compares the keyword lists, and outputs a CSV of keywords the competitor ranks for that the client site does not, sorted by search volume.
Copy this prompt to try it in Replit
Content Idea Suggester
A Replit API powers a content idea board where writers enter a topic and instantly see the top-performing content URLs currently ranking for related keywords, along with estimated traffic, social shares, and backlink counts from Ubersuggest's content ideas endpoint. This gives writers data-driven topic ideas rather than guessing what might perform well.
Write an Express server with a /content-ideas route that accepts a keyword, queries Ubersuggest's content ideas endpoint, and returns the top 10 URLs with title, estimated visits, backlinks, and social share counts.
Copy this prompt to try it in Replit
Troubleshooting
HTTP 401 Unauthorized when calling the Ubersuggest API
Cause: The API key is not being sent in the correct format, or the key in Replit Secrets is incorrect or has been regenerated.
Solution: Verify the Authorization header format is 'Bearer {your_api_key}'. Check that UBERSUGGEST_API_KEY in Replit Secrets contains the exact key value without extra spaces or quotes. Log in to Ubersuggest and check your account settings to confirm the key has not been regenerated.
1# Verify the header format2headers = {3 'Authorization': f'Bearer {os.environ["UBERSUGGEST_API_KEY"]}'4}5print('Auth header:', headers['Authorization'][:30], '...') # debugHTTP 403 Forbidden — API not accessible on current plan
Cause: Ubersuggest API access requires a paid subscription. Free or expired trial accounts cannot use the API.
Solution: Log into https://app.neilpatel.com and verify your subscription is active and includes API access. If your subscription lapsed, renew it. Check the API section in account settings to confirm your key is valid and active.
Empty suggestions array for a keyword that returns results in the Ubersuggest web UI
Cause: The country or language parameter may not match what you see in the web UI, or the web UI and API may use different databases with slightly different coverage.
Solution: Try the same keyword without the country and language parameters first. Then add them back one at a time to isolate which parameter causes empty results. Also verify the keyword is in the correct language for the country selected.
1# Test without country/language first2params = {'keyword': keyword}3# Then add: params['country'] = 'us'4# Then add: params['language'] = 'en'Rate limit error (429) after running multiple keyword queries quickly
Cause: Ubersuggest API rate limits vary by plan. Running multiple queries in rapid succession for batch processing can exhaust per-minute or per-day limits.
Solution: Add delays between API calls in batch scripts (0.5-1 second between requests). Cache results to avoid repeating queries. Check your plan's rate limit documentation in the Ubersuggest account settings.
1import time23keywords = ['seo tools', 'keyword research', 'link building']4results = []5for kw in keywords:6 results.append(ubersuggest_get('/keywords/overview', {'keyword': kw}))7 time.sleep(0.5) # Respect rate limits between callsBest practices
- Store UBERSUGGEST_API_KEY in Replit Secrets (lock icon 🔒) and never include it in client-side JavaScript or API responses.
- Cache keyword suggestion results for several hours — Ubersuggest data updates monthly, so repeated queries within a day waste API quota.
- Always pass the country and language parameters for location-specific search volume data that matches your target market.
- Use the keyword difficulty score to prioritize content creation — target keywords with a difficulty score below 40 for faster ranking wins.
- Implement rate limit handling with exponential backoff or delays between batch queries to avoid hitting plan limits.
- Deploy on Autoscale for on-demand keyword research APIs — the workload is purely reactive and does not need always-on compute.
- Combine Ubersuggest keyword data with your own content performance data to build a comprehensive content gap analysis, not just a list of suggestions.
- Always verify API endpoint URLs against the current Ubersuggest documentation — URLs and parameter names may change between API versions.
Alternatives
SEMrush provides more comprehensive keyword and competitive intelligence data with a larger index, making it a better choice for professional SEO agencies that need enterprise-grade accuracy and depth.
Ahrefs has the largest backlink index and strongest keyword difficulty scoring methodology, making it better for campaigns where link building and competitive analysis are as important as keyword research.
SpyFu specializes in competitor PPC and historical ad spend intelligence, making it the better tool when your focus is on competitive paid search analysis rather than keyword volume research.
Frequently asked questions
How do I get an Ubersuggest API key?
Log into your Ubersuggest account at https://app.neilpatel.com and navigate to your profile or account settings. The API key is displayed in the API section. API access requires a paid individual plan or higher — free accounts do not have API access.
Is the Ubersuggest API free to use?
No. Ubersuggest API access requires a paid subscription (Individual plan or higher). The free tier only provides limited access through the Ubersuggest web UI with no API access. Paid plans include API access within the plan's rate limits.
How accurate are Ubersuggest search volume estimates?
Ubersuggest search volume estimates are based on Google Keyword Planner data plus Ubersuggest's own modeling. They are reliable for relative comparison between keywords — comparing 1,000 monthly searches vs 10,000 monthly searches is meaningful. Absolute numbers may differ from Google Search Console data for your specific site.
Can I use Ubersuggest for keyword research in languages other than English?
Yes. The Ubersuggest API accepts a language parameter (ISO 639-1 codes like 'es', 'fr', 'de') alongside the country parameter. Pass both to get location and language-specific search volume data. Not all language and country combinations have equal data coverage — major markets have more reliable data.
How do I avoid hitting Ubersuggest API rate limits in Replit?
Cache results for frequently searched keywords using a dictionary (Python) or Map (Node.js) with timestamp-based expiry. For batch keyword analysis scripts, add a 500ms delay between API calls. Check your account plan documentation for specific rate limits — daily and per-minute limits vary by subscription tier.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation