Choose the SDK that fits your stack and start coding in seconds.


JavaScript / TypeScript

npm install fetchserp
# or
yarn add fetchserp
example.ts
import FetchSERP from 'fetchserp';

const client = new FetchSERP('YOUR_API_TOKEN');
const serp = await client.serp({
  query: 'serp api',
  search_engine: 'google',
  country: 'us',
  pages_number: 1
});
console.log(serp.data.results);

Python

pip install fetchserp
example.py
from fetchserp import FetchSERP

client = FetchSERP('YOUR_API_TOKEN')
results = client.serp(query='serp api', search_engine='google', country='us', pages_number=1)
print(results['data']['results'])

Ruby

gem install fetchserp
example.rb
require 'fetchserp'

client = FetchSERP::Client.new(api_key: 'YOUR_API_TOKEN')
results = client.serp(query: 'serp api', search_engine: 'google', country: 'us', pages_number: 1)
puts results['data']['results']

Available Methods

All SDKs expose a 1-to-1 mapping between helper methods and API endpoints:

serp(query, search_engine="google", country="us", pages_number=1)
ranking(domain, keyword, search_engine="google", country="us")
serp_html(...)
serp_text(...)
serp_js(...)
serp_ai(...)
page_indexation(...)
keywords_search_volume(keywords, country="us")
keywords_suggestions(keywords=None, url=None, country="us")
long_tail_keywords_generator(keyword, search_intent="informational", count=10)
backlinks(domain, pages_number=1)
web_page_seo_analysis(url)
web_page_ai_analysis(url, prompt)
...etc

Each method returns the raw JSON the API responds with, along with HTTP metadata.


Contributing & Support

All SDKs are open source on our GitHub organization. Feel free to open issues or PRs.

Need an SDK in another language? Open a feature request or reach out to support@fetchserp.com.