### Quick Start Example Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md A basic example demonstrating how to initialize the client and fetch SERP data. ```APIDOC ## Quick start ```python from fetchserp import FetchSERPClient API_KEY = "YOUR_SECRET_API_KEY" with FetchSERPClient(API_KEY) as fs: serp = fs.get_serp(query="python asyncio", pages_number=2) print(serp["data"]["results_count"], "results fetched") ``` The client raises `fetchserp.client.FetchSERPError` on any non-2xx response for easy error-handling. ``` -------------------------------- ### Install FetchSERP SDK Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Use pip to install the package. ```bash python -m pip install fetchserp ``` -------------------------------- ### Installation Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Install the FetchSERP Python SDK using pip. It has minimal dependencies, primarily the 'requests' library. ```APIDOC ## Installation ```bash python -m pip install fetchserp ``` > Only the `requests` package is installed; no heavy dependencies. ``` -------------------------------- ### Example: Fast AI Overview & AI Mode Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Illustrates a single API call to get both AI Overview and AI Mode responses for a query. ```APIDOC ### 3. Fast AI Overview & AI Mode (single call) ```python result = fs.get_serp_ai_mode(query="how to learn python programming") print(result["data"]["results"][0]["ai_overview"]["content"]) print(result["data"]["results"][0]["ai_mode_response"]["content"]) ``` ``` -------------------------------- ### Example: Long-tail keyword ideas Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Demonstrates how to use the `generate_long_tail_keywords` method to get keyword ideas. ```APIDOC ### 1. Long-tail keyword ideas ```python ideas = fs.generate_long_tail_keywords(keyword="electric cars", count=25) ``` ``` -------------------------------- ### Example: Automate browser tasks with AI Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Shows an example of using AI for browser automation tasks with Playwright. ```APIDOC ### 5. Automate browser tasks with AI ```python result = fs.get_playwright_mcp(prompt="Navigate to github.com and search for 'python selenium'") print(result["data"]["response"]) ``` ``` -------------------------------- ### GET /api/v1/generate_wordpress_content Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Generates WordPress content using AI. ```APIDOC ## GET /api/v1/generate_wordpress_content ### Description AI-powered WordPress content generation ### Method GET ### Endpoint `/api/v1/generate_wordpress_content` ``` -------------------------------- ### Example: JS-rendered SERP with AI overview Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Shows how to fetch a JS-rendered SERP and access its AI overview. ```APIDOC ### 2. JS-rendered SERP with AI overview ```python job = fs.start_serp_js_job(query="best coffee makers", country="us") result = fs.get_serp_js_result(uuid=job["data"]["uuid"]) print(result["data"]["results"][0]["ai_overview"]["content"]) ``` ``` -------------------------------- ### GET /api/v1/serp_html Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves a SERP including the full HTML content. ```APIDOC ## GET /api/v1/serp_html ### Description SERP with full HTML ### Method GET ### Endpoint `/api/v1/serp_html` ``` -------------------------------- ### GET /api/v1/serp_js Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Launches a job to retrieve a JavaScript-rendered SERP. Returns a UUID to poll for results. ```APIDOC ## GET /api/v1/serp_js ### Description Launch JS-rendered SERP job (returns UUID) ### Method GET ### Endpoint `/api/v1/serp_js` ``` -------------------------------- ### Example: Scrape a page with custom JavaScript Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Demonstrates scraping a webpage after executing custom JavaScript code. ```APIDOC ### 4. Scrape a page with custom JavaScript ```python payload = { "url": "https://fetchserp.com", "js_script": "return { title: document.title, h1: document.querySelector('h1')?.textContent };" } result = fs.scrape_webpage_js(**payload) ``` ``` -------------------------------- ### GET /api/v1/domain_infos Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Fetches DNS, WHOIS, SSL, and technology stack information for a domain. ```APIDOC ## GET /api/v1/domain_infos ### Description DNS, WHOIS, SSL & stack ### Method GET ### Endpoint `/api/v1/domain_infos` ``` -------------------------------- ### GET /api/v1/moz Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Fetches Moz domain authority metrics. ```APIDOC ## GET /api/v1/moz ### Description Moz domain authority metrics ### Method GET ### Endpoint `/api/v1/moz` ``` -------------------------------- ### GET /api/v1/serp_ai_mode Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves a SERP with AI Overview and AI Mode content. This is a fast endpoint, typically completing in under 30 seconds. ```APIDOC ## GET /api/v1/serp_ai_mode ### Description SERP with AI Overview & AI Mode (fast, <30s) ### Method GET ### Endpoint `/api/v1/serp_ai_mode` ``` -------------------------------- ### GET /api/v1/user Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Fetches information about the current user, including their credit balance. ```APIDOC ## GET /api/v1/user ### Description Current user info + credit balance ### Method GET ### Endpoint `/api/v1/user` ``` -------------------------------- ### GET /api/v1/serp Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves a static Search Engine Results Page (SERP). ```APIDOC ## GET /api/v1/serp ### Description SERP (static) ### Method GET ### Endpoint `/api/v1/serp` ``` -------------------------------- ### GET /api/v1/keywords_suggestions Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Generates keyword ideas based on a URL or a seed list. ```APIDOC ## GET /api/v1/keywords_suggestions ### Description Keyword ideas by URL or seed list ### Method GET ### Endpoint `/api/v1/keywords_suggestions` ``` -------------------------------- ### GET /api/v1/serp_text Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves a SERP with extracted text content. ```APIDOC ## GET /api/v1/serp_text ### Description SERP + extracted text ### Method GET ### Endpoint `/api/v1/serp_text` ``` -------------------------------- ### GET /api/v1/long_tail_keywords_generator Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Generates long-tail keyword variations. ```APIDOC ## GET /api/v1/long_tail_keywords_generator ### Description Long-tail keyword generator ### Method GET ### Endpoint `/api/v1/long_tail_keywords_generator` ``` -------------------------------- ### Get Domain Ranking with Python Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves the ranking position of a domain for a specific keyword across multiple SERP pages. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: ranking = fs.get_domain_ranking( keyword="web scraping python", domain="scrapy.org", search_engine="google", country="us", pages_number=10 ) print(f"Domain: {ranking['data']['domain']}") print(f"Keyword: {ranking['data']['keyword']}") print(f"Ranking position: {ranking['data']['position']}") print(f"URL found: {ranking['data']['url']}") ``` -------------------------------- ### Perform Comprehensive SEO Audit Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Use this function to get a detailed SEO analysis of a given webpage. Requires the Fetchserp library to be initialized. ```python result = fs.get_webpage_seo_analysis(url="https://fetchserp.com") print(result["data"]["summary"]) ``` -------------------------------- ### GET /api/v1/domain_emails Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Discovers emails associated with a domain. ```APIDOC ## GET /api/v1/domain_emails ### Description Emails discovered on a domain ### Method GET ### Endpoint `/api/v1/domain_emails` ``` -------------------------------- ### GET /api/v1/generate_social_content Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Generates social media content using AI. ```APIDOC ## GET /api/v1/generate_social_content ### Description AI-powered social media content generation ### Method GET ### Endpoint `/api/v1/generate_social_content` ``` -------------------------------- ### GET /api/v1/backlinks Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves backlinks for a given domain. ```APIDOC ## GET /api/v1/backlinks ### Description Backlinks for a domain ### Method GET ### Endpoint `/api/v1/backlinks` ``` -------------------------------- ### GET /get_serp_html Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves SERP results along with the full HTML content of each result page. ```APIDOC ## GET /get_serp_html ### Description Retrieves SERP results along with the full HTML content of each result page, enabling deeper analysis of page structure and content. ### Parameters #### Request Body - **query** (string) - Required - The search query string. - **search_engine** (string) - Optional - The search engine to use. - **country** (string) - Optional - The geographic target. - **pages_number** (integer) - Optional - Number of pages to retrieve. ### Response #### Success Response (200) - **data** (object) - Contains a list of results including 'url' and 'html' fields. ``` -------------------------------- ### GET /get_serp Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves search engine results pages in a structured format without JavaScript rendering. ```APIDOC ## GET /get_serp ### Description Retrieves search engine results pages in a structured format without JavaScript rendering. Supports multiple search engines and geographic targeting. ### Parameters #### Request Body - **query** (string) - Required - The search query string. - **search_engine** (string) - Optional - The search engine to use (e.g., 'google'). - **country** (string) - Optional - The geographic target for results. - **pages_number** (integer) - Optional - Number of pages to retrieve. ### Response #### Success Response (200) - **data** (object) - Contains results_count and a list of result objects. ``` -------------------------------- ### GET /api/v1/page_indexation Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Checks if a specific URL is indexed for a given keyword. ```APIDOC ## GET /api/v1/page_indexation ### Description Checks if a URL is indexed for a keyword ### Method GET ### Endpoint `/api/v1/page_indexation` ``` -------------------------------- ### GET /get_serp_js_result Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Polls for the results of an asynchronous JS rendering job. ```APIDOC ## GET /get_serp_js_result ### Description Retrieves the results of a previously started JS rendering job using its UUID. ### Parameters #### Query Parameters - **uuid** (string) - Required - The unique identifier of the job. ### Response #### Success Response (200) - **data** (object) - Contains 'status' and 'results' including AI-generated summaries. ``` -------------------------------- ### GET /api/v1/ranking Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves the ranking position of a domain for a specific keyword. ```APIDOC ## GET /api/v1/ranking ### Description Ranking position of a domain for a keyword ### Method GET ### Endpoint `/api/v1/ranking` ``` -------------------------------- ### GET /api/v1/webpage_ai_analysis Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Performs a custom AI analysis on any given webpage. ```APIDOC ## GET /api/v1/webpage_ai_analysis ### Description Custom AI analysis of any webpage ### Method GET ### Endpoint `/api/v1/webpage_ai_analysis` ``` -------------------------------- ### GET /api/v1/webpage_seo_analysis Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Performs a comprehensive on-page SEO audit for a webpage. ```APIDOC ## GET /api/v1/webpage_seo_analysis ### Description Full on-page SEO audit ### Method GET ### Endpoint `/api/v1/webpage_seo_analysis` ``` -------------------------------- ### GET /api/v1/scrape_domain Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Crawls multiple pages of a domain for scraping purposes. ```APIDOC ## GET /api/v1/scrape_domain ### Description Crawl multiple pages of a domain ### Method GET ### Endpoint `/api/v1/scrape_domain` ``` -------------------------------- ### GET /api/v1/scrape Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Performs a static scrape of a webpage (without JavaScript rendering). ```APIDOC ## GET /api/v1/scrape ### Description Static scrape (no JS) ### Method GET ### Endpoint `/api/v1/scrape` ``` -------------------------------- ### GET /get_serp_text Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves SERP results with extracted visible text content. ```APIDOC ## GET /get_serp_text ### Description Retrieves SERP results with extracted visible text content from each page, useful for content analysis without HTML parsing overhead. ### Parameters #### Request Body - **query** (string) - Required - The search query string. - **search_engine** (string) - Optional - The search engine to use. - **country** (string) - Optional - The geographic target. - **pages_number** (integer) - Optional - Number of pages to retrieve. ### Response #### Success Response (200) - **data** (object) - Contains a list of results including 'title' and 'text' fields. ``` -------------------------------- ### GET /api/v1/playwright_mcp Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Utilizes Playwright and MCP for GPT-4.1 browser automation tasks. ```APIDOC ## GET /api/v1/playwright_mcp ### Description GPT-4.1 browser automation via Playwright MCP ### Method GET ### Endpoint `/api/v1/playwright_mcp` ``` -------------------------------- ### GET /api/v1/serp_js/{uuid} Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Polls for the results of a previously launched JS-rendered SERP job using its UUID. ```APIDOC ## GET /api/v1/serp_js/{uuid} ### Description Poll job result ### Method GET ### Endpoint `/api/v1/serp_js/{uuid}` #### Path Parameters - **uuid** (string) - Required - The UUID of the JS SERP job. ``` -------------------------------- ### GET /api/v1/keywords_search_volume Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieves Google Ads search volume data for specified keywords. ```APIDOC ## GET /api/v1/keywords_search_volume ### Description Google Ads search volume ### Method GET ### Endpoint `/api/v1/keywords_search_volume` ``` -------------------------------- ### Retrieve Keyword Search Volume Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Gets monthly search volume and competition data for specified keywords from Google Ads. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: volume_data = fs.get_keywords_search_volume( keywords=["python tutorial", "learn python", "python for beginners"], country="us" ) for keyword_data in volume_data['data']['keywords']: print(f"Keyword: {keyword_data['keyword']}") print(f"Monthly volume: {keyword_data['search_volume']}") print(f"Competition: {keyword_data['competition']}\n") ``` -------------------------------- ### Generate Engaging Social Media Content Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Create social media posts tailored for platforms like LinkedIn. Provide a user prompt, a system prompt to guide the AI, and select an AI model. ```python result = fs.generate_social_content( user_prompt="Create a LinkedIn post about the benefits of using Python for data analysis", system_prompt="You are a social media expert. Create engaging, professional content that drives engagement.", ai_model="gpt-4.1-nano" ) print(result["data"]["response"]["content"]) ``` -------------------------------- ### Get Webpage AI Analysis Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Analyzes a webpage using AI with a custom prompt, enabling flexible content analysis and extraction. ```APIDOC ## get_webpage_ai_analysis ### Description Analyzes a webpage using AI with a custom prompt, enabling flexible content analysis and extraction. ### Method POST ### Endpoint /get_webpage_ai_analysis ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the web page to analyze. - **prompt** (string) - Required - The custom prompt for the AI analysis. ### Request Example ```python fs.get_webpage_ai_analysis(url="https://example.com/product-page", prompt="Extract the product name, price, and key features. Summarize customer reviews if present.") ``` ### Response #### Success Response (200) - **data** (object) - **response** (string) - The AI-generated analysis of the webpage content. ``` -------------------------------- ### Get Domain Ranking Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves the ranking position of a domain for a specific keyword across multiple SERP pages. ```APIDOC ## get_domain_ranking ### Description Retrieves the ranking position of a domain for a specific keyword across multiple SERP pages. ### Method POST ### Endpoint /get_domain_ranking ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to search for. - **domain** (string) - Required - The domain to check the ranking for. - **search_engine** (string) - Optional - The search engine to use (e.g., "google", "bing"). Defaults to "google". - **country** (string) - Optional - The country code for the search (e.g., "us", "uk"). Defaults to "us". - **pages_number** (integer) - Optional - The number of SERP pages to scrape. Defaults to 1. ### Request Example ```python fs.get_domain_ranking(keyword="web scraping python", domain="scrapy.org", search_engine="google", country="us", pages_number=10) ``` ### Response #### Success Response (200) - **data** (object) - **domain** (string) - The domain that was searched. - **keyword** (string) - The keyword that was searched. - **position** (integer) - The ranking position of the domain. - **url** (string) - The URL found in the search results. ``` -------------------------------- ### Get Webpage SEO Analysis Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Runs a comprehensive on-page SEO audit for a URL, checking title tags, meta descriptions, headings, content quality, and technical SEO factors. ```APIDOC ## get_webpage_seo_analysis ### Description Runs a comprehensive on-page SEO audit for a URL, checking title tags, meta descriptions, headings, content quality, and technical SEO factors. ### Method POST ### Endpoint /get_webpage_seo_analysis ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the web page to audit. ### Request Example ```python fs.get_webpage_seo_analysis(url="https://example.com") ``` ### Response #### Success Response (200) - **data** (object) - **score** (integer) - The overall SEO score. - **summary** (string) - A summary of the SEO audit. - **issues** (array) - A list of SEO issues found. - **severity** (string) - The severity of the issue (e.g., "error", "warning"). - **message** (string) - A description of the issue. - **recommendations** (array) - A list of recommendations for improving SEO. ``` -------------------------------- ### POST /start_serp_js_job Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Launches an asynchronous SERP job with full JavaScript rendering. ```APIDOC ## POST /start_serp_js_job ### Description Launches an asynchronous SERP job with full JavaScript rendering and AI overview extraction. ### Parameters #### Request Body - **query** (string) - Required - The search query string. - **country** (string) - Optional - The geographic target. - **pages_number** (integer) - Optional - Number of pages to retrieve. ### Response #### Success Response (200) - **data** (object) - Contains the 'uuid' of the started job. ``` -------------------------------- ### Initialize FetchSERP Client Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Basic usage pattern for the client using a context manager. ```python from fetchserp import FetchSERPClient API_KEY = "YOUR_SECRET_API_KEY" with FetchSERPClient(API_KEY) as fs: serp = fs.get_serp(query="python asyncio", pages_number=2) print(serp["data"]["results_count"], "results fetched") ``` -------------------------------- ### Build and Upload Python Package Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Commands to build a Python package using 'build' and upload it to PyPI using 'twine'. Ensure you are in the correct directory and have the necessary build artifacts. ```bash source .venv/bin/activate python -m build twine upload dist/* ``` -------------------------------- ### FetchSERP Client Initialization Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/fetchserp.egg-info/SOURCES.txt Initializes the FetchSERP client to interact with the API service. ```APIDOC ## Initialization ### Description Initializes the FetchSERP client instance using the provided configuration. ### Endpoint fetchserp.client.Client ### Parameters #### Request Body - **api_key** (string) - Required - The API key used for authentication with the FetchSERP service. ``` -------------------------------- ### Authentication Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Authenticate your requests by providing your API key when initializing the FetchSERPClient. The SDK automatically handles the 'Authorization: Bearer ' header. ```APIDOC ## Authentication All endpoints require a **Bearer token**. Pass your key when constructing the client: ```python from fetchserp import FetchSERPClient API_KEY = "YOUR_SECRET_API_KEY" fs = FetchSERPClient(API_KEY) ``` The SDK automatically adds `Authorization: Bearer ` to every request. ``` -------------------------------- ### Retrieve AI Overview and AI Mode Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Fetch SERP data including AI-generated content in a single request. ```python result = fs.get_serp_ai_mode(query="how to learn python programming") print(result["data"]["results"][0]["ai_overview"]["content"]) print(result["data"]["results"][0]["ai_mode_response"]["content"]) ``` -------------------------------- ### Check Page Indexation with Python Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Verifies if a specific domain or page is indexed for a given keyword. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: indexation = fs.check_page_indexation( domain="example.com", keyword="python programming" ) print(f"Is indexed: {indexation['data']['indexed']}") if indexation['data']['indexed']: print(f"Position: {indexation['data']['position']}") ``` -------------------------------- ### Generate WordPress Content with AI Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Creates SEO-optimized blog content using customizable system and user prompts. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: content = fs.generate_wordpress_content( user_prompt="Write a comprehensive blog post about Python web scraping best practices, including code examples", system_prompt="You are an expert SEO content writer specializing in technical tutorials. Create engaging, informative content optimized for search engines with proper heading structure.", ai_model="gpt-4.1-nano" ) print(f"Title: {content['data']['response']['title']}") print(f"Meta Description: {content['data']['response']['meta_description']}") print(f"Content:\n{content['data']['response']['content']}") ``` -------------------------------- ### Implement API Error Handling Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Demonstrates how to catch FetchSERPError and other exceptions for robust application resilience. ```python from fetchserp import FetchSERPClient from fetchserp.client import FetchSERPError with FetchSERPClient(api_key="your_api_key") as fs: try: result = fs.get_serp(query="test query") except FetchSERPError as e: # Handle API errors (4xx, 5xx responses) print(f"API Error: {e}") except ValueError as e: # Handle validation errors (e.g., missing required parameters) print(f"Validation Error: {e}") except Exception as e: # Handle network or other errors print(f"Unexpected error: {e}") ``` -------------------------------- ### Fetch Domain Information Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves comprehensive domain details including DNS, WHOIS, SSL status, and technology stack. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: info = fs.get_domain_info(domain="github.com") print(f"Domain: {info['data']['domain']}") print(f"DNS Records: {info['data']['dns']}") print(f"WHOIS Registrar: {info['data']['whois']['registrar']}") print(f"SSL Valid: {info['data']['ssl']['valid']}") print(f"Technologies: {info['data']['technologies']}") ``` -------------------------------- ### Retrieve SERP with AI Mode Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetches search results along with AI-generated overviews and mode responses in a single request. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: result = fs.get_serp_ai_mode(query="how to learn python programming") # Access AI-generated overview ai_overview = result["data"]["results"][0]["ai_overview"]["content"] print(f"AI Overview:\n{ai_overview}\n") # Access AI mode response ai_mode = result["data"]["results"][0]["ai_mode_response"]["content"] print(f"AI Mode Response:\n{ai_mode}") ``` -------------------------------- ### Automate Browser Tasks with Playwright MCP Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Uses GPT-4.1 to control a browser remotely via Playwright MCP for complex automation tasks. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: result = fs.get_playwright_mcp( prompt="Navigate to github.com, search for 'python selenium', and return the top 5 repository names and their star counts" ) print(f"Automation result:\n{result['data']['response']}") ``` -------------------------------- ### Execute JS-rendered SERP Job Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Launch a job for JS-rendered SERP results and poll for the outcome using the returned UUID. ```python job = fs.start_serp_js_job(query="best coffee makers", country="us") result = fs.get_serp_js_result(uuid=job["data"]["uuid"]) print(result["data"]["results"][0]["ai_overview"]["content"]) ``` -------------------------------- ### Perform SEO Analysis with Python Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Runs a comprehensive on-page SEO audit for a URL, checking title tags, meta descriptions, headings, content quality, and technical SEO factors. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: seo_audit = fs.get_webpage_seo_analysis(url="https://example.com") print(f"SEO Score: {seo_audit['data']['score']}") print(f"Summary: {seo_audit['data']['summary']}") print("\nIssues found:") for issue in seo_audit['data']['issues']: print(f" - {issue['severity']}: {issue['message']}") print("\nRecommendations:") for rec in seo_audit['data']['recommendations']: print(f" - {rec}") ``` -------------------------------- ### Generate Keyword Suggestions Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Provides keyword ideas based on a provided URL or a list of seed keywords. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: # From a URL suggestions = fs.get_keywords_suggestions( url="https://example.com/blog/python-tutorial", country="us" ) # From seed keywords suggestions = fs.get_keywords_suggestions( keywords=["machine learning", "deep learning"], country="us" ) for suggestion in suggestions['data']['suggestions']: print(f"Suggested keyword: {suggestion}") ``` -------------------------------- ### Generate SEO-Optimized WordPress Content Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Generate blog post content optimized for SEO. Specify a user prompt, a system prompt to define the AI's role, and the desired AI model. ```python result = fs.generate_wordpress_content( user_prompt="Write a blog post about Python web scraping best practices", system_prompt="You are an expert SEO content writer. Create engaging, informative content optimized for search engines.", ai_model="gpt-4.1-nano" ) print(result["data"]["response"]["title"]) print(result["data"]["response"]["content"]) ``` -------------------------------- ### Retrieve SERP HTML Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetch SERP results including the full HTML content of each page for deeper analysis. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: results = fs.get_serp_html( query="machine learning frameworks", search_engine="google", country="us", pages_number=1 ) for result in results['data']['results']: print(f"URL: {result['url']}") print(f"HTML length: {len(result['html'])} characters") # Parse HTML with BeautifulSoup or similar ``` -------------------------------- ### get_domain_info Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetches comprehensive domain information. ```APIDOC ## get_domain_info ### Description Fetches comprehensive domain information including DNS records, WHOIS data, SSL certificate details, and detected technology stack. ### Parameters #### Request Body - **domain** (string) - Required - The target domain. ``` -------------------------------- ### Execute Asynchronous JS Jobs Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Use a two-step process to launch jobs requiring JavaScript rendering and poll for the final results. ```python from fetchserp import FetchSERPClient import time with FetchSERPClient(api_key="your_api_key") as fs: # Step 1: Start the JS rendering job job = fs.start_serp_js_job( query="best coffee makers 2024", country="us", pages_number=1 ) job_uuid = job["data"]["uuid"] print(f"Job started with UUID: {job_uuid}") # Step 2: Poll for results (with retry logic) max_attempts = 10 for attempt in range(max_attempts): result = fs.get_serp_js_result(uuid=job_uuid) if result["data"]["status"] == "completed": print("AI Overview:", result["data"]["results"][0]["ai_overview"]["content"]) for item in result["data"]["results"]: print(f"- {item['title']}: {item['url']}") break time.sleep(3) # Wait before polling again ``` -------------------------------- ### get_keywords_suggestions Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Generates keyword suggestions based on a URL or seed keywords. ```APIDOC ## get_keywords_suggestions ### Description Generates keyword suggestions based on a URL or a seed list of keywords, useful for expanding keyword research. ### Parameters #### Request Body - **url** (string) - Optional - URL to extract suggestions from. - **keywords** (list) - Optional - Seed keywords to expand. - **country** (string) - Optional - The country code for the search. ``` -------------------------------- ### Automate Browser Tasks with AI Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Use Playwright MCP to perform browser automation based on a natural language prompt. ```python result = fs.get_playwright_mcp(prompt="Navigate to github.com and search for 'python selenium'") print(result["data"]["response"]) ``` -------------------------------- ### POST /api/v1/scrape_js_with_proxy Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Scrapes a webpage using JavaScript rendering and a residential proxy. ```APIDOC ## POST /api/v1/scrape_js_with_proxy ### Description JS scrape using residential proxy ### Method POST ### Endpoint `/api/v1/scrape_js_with_proxy` ``` -------------------------------- ### Analyze Webpage with AI Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Analyzes a webpage using AI with a custom prompt, enabling flexible content analysis and extraction. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: analysis = fs.get_webpage_ai_analysis( url="https://example.com/product-page", prompt="Extract the product name, price, and key features. Summarize customer reviews if present." ) print(f"AI Analysis:\n{analysis['data']['response']}") ``` -------------------------------- ### Retrieve User Account Information Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetches current API user details, including account status and remaining credits. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: user = fs.get_user() print(f"User ID: {user['data']['id']}") print(f"Email: {user['data']['email']}") print(f"Credits remaining: {user['data']['credits']}") print(f"Plan: {user['data']['plan']}") ``` -------------------------------- ### get_serp_ai_mode Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves SERP results with AI Overview and AI Mode response in a single call. ```APIDOC ## get_serp_ai_mode ### Description Retrieves SERP results with AI Overview and AI Mode response in a single call. Faster than the two-step JS process but may be less reliable for complex queries. ### Parameters #### Request Body - **query** (string) - Required - The search query to perform. ``` -------------------------------- ### Retrieve Moz Domain Analysis Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetches Moz-specific metrics including Domain Authority, Page Authority, and link counts. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: moz_data = fs.get_moz_domain_analysis(domain="github.com") print(f"Domain Authority: {moz_data['data']['domain_authority']}") print(f"Page Authority: {moz_data['data']['page_authority']}") print(f"Linking Domains: {moz_data['data']['linking_domains']}") print(f"Inbound Links: {moz_data['data']['inbound_links']}") ``` -------------------------------- ### Generate Long-tail Keywords Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Retrieve keyword suggestions based on a seed keyword. ```python ideas = fs.generate_long_tail_keywords(keyword="electric cars", count=25) ``` -------------------------------- ### Retrieve SERP Data Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetch search engine results in a structured format without JavaScript rendering. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: # Basic SERP retrieval results = fs.get_serp(query="python web scraping tutorial") print(f"Total results: {results['data']['results_count']}") for result in results['data']['results']: print(f"Title: {result['title']}") print(f"URL: {result['url']}") print(f"Description: {result['description']}\n") # Advanced: Multi-page results with geo-targeting results = fs.get_serp( query="best restaurants", search_engine="google", country="uk", pages_number=3 ) ``` -------------------------------- ### Authenticate with Bearer Token Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Pass the API key during client instantiation to authenticate requests. ```python fs = FetchSERPClient("BEARER_TOKEN") ``` -------------------------------- ### Scrape Domain with Python Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Crawls multiple pages from a domain, useful for site-wide content extraction. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: crawl_results = fs.scrape_domain( domain="example.com", max_pages=10 ) print(f"Pages crawled: {len(crawl_results['data']['pages'])}") for page in crawl_results['data']['pages']: print(f"URL: {page['url']}") print(f"Title: {page['title']}") print(f"Word count: {page['word_count']}\n") ``` -------------------------------- ### Retrieve SERP Text Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetch SERP results with visible text content extracted, avoiding the need for manual HTML parsing. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: results = fs.get_serp_text( query="climate change research", search_engine="google", country="us", pages_number=2 ) for result in results['data']['results']: print(f"Title: {result['title']}") print(f"Extracted text preview: {result['text'][:500]}...") ``` -------------------------------- ### Scrape Page (with JavaScript and Proxy) Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Scrapes a web page with JavaScript execution through a residential proxy in the specified country, useful for geo-restricted content. ```APIDOC ## scrape_page_js_with_proxy ### Description Scrapes a web page with JavaScript execution through a residential proxy in the specified country, useful for geo-restricted content. ### Method POST ### Endpoint /scrape_page_js_with_proxy ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the web page to scrape. - **country** (string) - Required - The country code for the proxy (e.g., "uk", "us"). - **js_script** (string) - Optional - A JavaScript snippet to execute on the page. ### Request Example ```python fs.scrape_page_js_with_proxy(url="https://example.com", country="uk", js_script="return { content: document.body.innerText };") ``` ### Response #### Success Response (200) - **data** (object) - **content** (string) - The extracted content from the page. ``` -------------------------------- ### get_keywords_search_volume Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves monthly search volume data from Google Ads. ```APIDOC ## get_keywords_search_volume ### Description Retrieves monthly search volume data from Google Ads for one or more keywords, essential for keyword research and content planning. ### Parameters #### Request Body - **keywords** (list) - Required - List of keywords to analyze. - **country** (string) - Optional - The country code for the search. ``` -------------------------------- ### Retrieve Domain Backlinks Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Fetches external backlink data for a specific domain, including source URLs and anchor text. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: backlinks = fs.get_backlinks( domain="example.com", search_engine="google", country="us", pages_number=15 ) print(f"Total backlinks found: {len(backlinks['data']['backlinks'])}") for link in backlinks['data']['backlinks']: print(f"Source: {link['source_url']}") print(f"Anchor: {link['anchor_text']}\n") ``` -------------------------------- ### Scrape Webpage with Custom JavaScript Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Execute custom JavaScript on a target URL to extract specific content. ```python payload = { "url": "https://fetchserp.com", "js_script": "return { title: document.title, h1: document.querySelector('h1')?.textContent };" } result = fs.scrape_webpage_js(**payload) ``` -------------------------------- ### Scrape Static Page with Python Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Scrapes a web page without JavaScript execution, returning the static HTML content. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: scraped = fs.scrape_page(url="https://example.com") print(f"Status: {scraped['data']['status_code']}") print(f"Content type: {scraped['data']['content_type']}") print(f"HTML content: {scraped['data']['html'][:1000]}...") ``` -------------------------------- ### Scrape Page with JavaScript and Proxy Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Scrapes a web page with JavaScript execution through a residential proxy in the specified country. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: result = fs.scrape_page_js_with_proxy( url="https://example.com", country="uk", js_script="return { content: document.body.innerText };" ) print(f"Content from UK proxy: {result['data']['content'][:500]}...") ``` -------------------------------- ### Check Page Indexation Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Checks if a given domain or page is indexed in search results for a specific keyword. ```APIDOC ## check_page_indexation ### Description Checks whether a specific domain/page is indexed in search results for a given keyword. ### Method POST ### Endpoint /check_page_indexation ### Parameters #### Query Parameters - **domain** (string) - Required - The domain or URL to check. - **keyword** (string) - Required - The keyword to search for. ### Request Example ```python fs.check_page_indexation(domain="example.com", keyword="python programming") ``` ### Response #### Success Response (200) - **data** (object) - **indexed** (boolean) - Indicates if the page is indexed. - **position** (integer) - The ranking position if indexed. ``` -------------------------------- ### get_moz_domain_analysis Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves Moz domain authority metrics. ```APIDOC ## get_moz_domain_analysis ### Description Retrieves Moz domain authority metrics including Domain Authority (DA), Page Authority (PA), and link metrics. ### Parameters #### Request Body - **domain** (string) - Required - The target domain. ``` -------------------------------- ### Scrape Domain Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Crawls multiple pages from a domain, useful for site-wide content extraction. ```APIDOC ## scrape_domain ### Description Crawls multiple pages from a domain, useful for site-wide content extraction. ### Method POST ### Endpoint /scrape_domain ### Parameters #### Query Parameters - **domain** (string) - Required - The domain to crawl. - **max_pages** (integer) - Optional - The maximum number of pages to crawl. Defaults to 10. ### Request Example ```python fs.scrape_domain(domain="example.com", max_pages=10) ``` ### Response #### Success Response (200) - **data** (object) - **pages** (array) - A list of crawled pages. - **url** (string) - The URL of the crawled page. - **title** (string) - The title of the crawled page. - **word_count** (integer) - The word count of the crawled page. ``` -------------------------------- ### Generate Social Media Content Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Produces engaging social media posts for platforms like LinkedIn, Twitter, or Facebook. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: social_post = fs.generate_social_content( user_prompt="Create a LinkedIn post about the benefits of using Python for data analysis, targeting data professionals", system_prompt="You are a social media expert. Create engaging, professional content that drives engagement and includes relevant hashtags.", ai_model="gpt-4.1-nano" ) print(f"Social Media Content:\n{social_post['data']['response']['content']}") ``` -------------------------------- ### POST /api/v1/scrape_js Source: https://github.com/fetchserp-llc/fetchserp-python/blob/main/README.md Scrapes a webpage after executing custom JavaScript code. ```APIDOC ## POST /api/v1/scrape_js ### Description Run custom JS & scrape ### Method POST ### Endpoint `/api/v1/scrape_js` ### Request Body - **url** (string) - Required - The URL to scrape. - **js_script** (string) - Required - The JavaScript code to execute. ``` -------------------------------- ### generate_long_tail_keywords Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Produces long-tail keyword variations for a seed keyword. ```APIDOC ## generate_long_tail_keywords ### Description Produces long-tail keyword variations for a seed keyword, filtered by search intent type. ### Parameters #### Request Body - **keyword** (string) - Required - The seed keyword. - **search_intent** (string) - Optional - The intent type (e.g., informational, transactional). - **count** (integer) - Optional - Number of variations to generate. ``` -------------------------------- ### Discover Domain Emails Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Searches public web pages to identify email addresses associated with a target domain. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: emails = fs.get_domain_emails( domain="example.com", search_engine="google", country="us", pages_number=1 ) for email in emails['data']['emails']: print(f"Found email: {email}") ``` -------------------------------- ### get_domain_emails Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Discovers email addresses associated with a domain. ```APIDOC ## get_domain_emails ### Description Discovers email addresses associated with a domain by searching public web pages. ### Parameters #### Request Body - **domain** (string) - Required - The target domain. - **search_engine** (string) - Optional - The search engine to use. - **country** (string) - Optional - The country code for the search. - **pages_number** (integer) - Optional - Number of pages to search. ``` -------------------------------- ### get_backlinks Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Retrieves backlink data for a specified domain. ```APIDOC ## get_backlinks ### Description Retrieves backlink data for a specified domain, showing which external sites link to the target domain. ### Parameters #### Request Body - **domain** (string) - Required - The target domain. - **search_engine** (string) - Optional - The search engine to use. - **country** (string) - Optional - The country code for the search. - **pages_number** (integer) - Optional - Number of pages to retrieve. ``` -------------------------------- ### Generate Long-Tail Keywords Source: https://context7.com/fetchserp-llc/fetchserp-python/llms.txt Produces keyword variations for a seed term, filtered by specific search intent types. ```python from fetchserp import FetchSERPClient with FetchSERPClient(api_key="your_api_key") as fs: # Informational intent keywords ideas = fs.generate_long_tail_keywords( keyword="electric cars", search_intent="informational", count=25 ) print("Long-tail keyword ideas:") for keyword in ideas['data']['keywords']: print(f" - {keyword}") # Transactional intent keywords transactional = fs.generate_long_tail_keywords( keyword="electric cars", search_intent="transactional", count=10 ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.