> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SEMrush Integration for AI Agents & Workflows

> Comprehensive SEO analytics platform for domain analysis, keyword research, backlink analysis, competitor research, and traffic analytics.

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img src="https://mintcdn.com/modulexaillc/df8MOr-hXotYLTh5/logos/semrush.svg?fit=max&auto=format&n=df8MOr-hXotYLTh5&q=85&s=b041c00ed08e7866e86d697cc4b4f79e" alt="SEMrush logo" width="72" height="72" data-path="logos/semrush.svg" />

## Overview

Add **SEMrush** to any ModuleX agent or workflow. SEO analytics integration: domain overview/keywords/competitors, backlinks, keyword research, traffic analytics, API-units balance. All 17 SEO actions hit `api.semrush.com` (CSV responses, semicolon separators); the two `.Trends` traffic actions hit `api.semrush.com/analytics/ta/api/v3/` (JSON responses).

<Info>
  **Categories**: Marketing & Advertising · Data & Analytics · Analytics · Marketing · Research · **Auth**: API Key · **Actions**: 19
</Info>

## Authentication

### API Key Authentication

Authenticate using your SEMrush API key

#### Required Credentials

| Field           | Description                             | Required | Format                             |
| --------------- | --------------------------------------- | -------- | ---------------------------------- |
| SEMrush API Key | Your SEMrush API key for authentication | Yes      | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |

## Available Actions

<AccordionGroup>
  <Accordion title="domain_overview — Get domain overview data including organic/paid search traffic, keywords, and rankings">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Domain name to analyze
    </ResponseField>

    <ResponseField name="database" type="string">
      Regional database (Default: `us`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "DomainOverviewOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="domain_organic_keywords — Get organic keywords for a domain with position, volume, and traffic data">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Domain name to analyze
    </ResponseField>

    <ResponseField name="database" type="string">
      Regional database (e.g. 'us', 'uk', 'ca', 'de', 'fr') (Default: `us`)
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of records to return (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "DomainOrganicKeywordsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="domain_paid_keywords — Get paid keywords for a domain with ad position and CPC data">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Domain name to analyze
    </ResponseField>

    <ResponseField name="database" type="string">
      Regional database (e.g. 'us', 'uk', 'ca', 'de', 'fr') (Default: `us`)
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of records to return (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "DomainPaidKeywordsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="competitors — Get organic-search competitors for a domain">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Domain name to analyze
    </ResponseField>

    <ResponseField name="database" type="string">
      Regional database (e.g. 'us', 'uk', 'ca', 'de', 'fr') (Default: `us`)
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of records to return (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "CompetitorsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="backlinks — Get backlinks for a domain or URL with source details and authority scores">
    ### Parameters

    <ResponseField name="target" type="string" required>
      Domain or URL to analyze
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum backlinks to return (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "BacklinksOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="backlinks_domains — Get referring domains for a domain or URL">
    ### Parameters

    <ResponseField name="target" type="string" required>
      Domain or URL to analyze
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum referring domains to return (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "BacklinksDomainsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="keyword_overview — Get overview data for a keyword including volume, CPC, and competition">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string">
      Database to use (Default: `us`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "KeywordOverviewOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="keyword_overview_single_db — Get detailed keyword overview from a specific database with difficulty score">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "KeywordOverviewSingleDbOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="batch_keyword_overview — Analyze up to 100 keywords at once in a specific database">
    ### Parameters

    <ResponseField name="keywords" type="array" required>
      Array of keywords (max 100)
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "BatchKeywordOverviewOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="related_keywords — Get semantically related keywords for a keyword">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string">
      Database to use (Default: `us`)
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of results (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "RelatedKeywordsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="keyword_organic_results — Get domains ranking in Google's top 100 for a keyword">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of results (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "KeywordOrganicResultsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="keyword_paid_results — Get domains in Google's paid search results for a keyword">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of results (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "KeywordPaidResultsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="keyword_ads_history — Get domains that bid on a keyword in the last 12 months">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of results (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "KeywordAdsHistoryOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="broad_match_keywords — Get broad matches and alternate search queries for a keyword">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of results (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "BroadMatchKeywordsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="phrase_questions — Get question-based keywords related to a term">
    ### Parameters

    <ResponseField name="keyword" type="string" required>
      Keyword to analyze
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of results (Default: `10`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "PhraseQuestionsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="keyword_difficulty — Get difficulty index (0-100) for ranking in Google's top 10">
    ### Parameters

    <ResponseField name="keywords" type="array" required>
      Array of keywords (max 100)
    </ResponseField>

    <ResponseField name="database" type="string" required>
      Database to use
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "records": {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "title": "Records",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "KeywordDifficultyOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="traffic_summary — Get traffic summary data for domains (requires .Trends API access)">
    ### Parameters

    <ResponseField name="domains" type="array" required>
      Array of domains to analyze
    </ResponseField>

    <ResponseField name="country" type="string">
      Country code (Default: `us`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "data": {
          "default": null,
          "title": "Data"
        }
      },
      "required": [
        "success"
      ],
      "title": "TrafficSummaryOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="traffic_sources — Get traffic sources breakdown for a domain (requires .Trends API access)">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Domain to analyze
    </ResponseField>

    <ResponseField name="country" type="string">
      Country code (Default: `us`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "data": {
          "default": null,
          "title": "Data"
        }
      },
      "required": [
        "success"
      ],
      "title": "TrafficSourcesOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="api_units_balance — Check the remaining API units balance in your SEMrush account">
    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "units": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Units"
        }
      },
      "required": [
        "success"
      ],
      "title": "ApiUnitsBalanceOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* SEMrush's main `https://api.semrush.com/` endpoint returns
  semicolon-separated CSV with a header row. The shared `_call_csv`
  helper parses it into `records: list[dict[str, str]]`.
* The two `.Trends` actions (`traffic_summary` / `traffic_sources`)
  return JSON (or text fallback) — surfaced verbatim on `data`.
* `batch_keyword_overview` and `keyword_difficulty` are capped at
  100 keywords per call (SEMrush's limit).
* API errors come back as HTTP 200 with `ERROR ...` body text — the
  helper detects this and converts to `success=False`.
* Each action carries an API-units cost (10-100 per record);
  consult SEMrush's docs.

## Related integrations

<CardGroup cols={3}>
  <Card title="Nasdaq Data Link" href="/integrations/tools/nasdaq" />

  <Card title="Short.io" href="/integrations/tools/short-io" />

  <Card title="Ahrefs" href="/integrations/tools/ahrefs" />
</CardGroup>

## Links

* [SEMrush](https://www.semrush.com)
