> ## 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.

# Similarweb Integration for AI Agents & Workflows

> Access comprehensive website analytics including traffic estimates, engagement metrics, rankings, and traffic sources using the Similarweb API.

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

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

## Overview

Add **Similarweb** to any ModuleX agent or workflow. Website traffic and analytics data: traffic estimates, engagement metrics, rankings, and traffic-source breakdowns from the Similarweb Web Traffic API (`api.similarweb.com`).

<Info>
  **Categories**: Analytics & Data · Marketing · Seo · **Auth**: API Key · **Actions**: 5
</Info>

## Authentication

### API Key Authentication

Authenticate using your Similarweb API key

<Steps>
  <Step title="Step 1">
    Sign in to your Similarweb account at [https://www.similarweb.com](https://www.similarweb.com)
  </Step>

  <Step title="Step 2">
    Open the API account dashboard at [https://account.similarweb.com](https://account.similarweb.com)
  </Step>

  <Step title="Step 3">
    Locate your API key under the API management section
  </Step>

  <Step title="Step 4">
    Paste the API key below
  </Step>
</Steps>

#### Required Credentials

| Field              | Description                         | Required | Format |
| ------------------ | ----------------------------------- | -------- | ------ |
| Similarweb API Key | Your Similarweb Web Traffic API key | Yes      | `-`    |

## Available Actions

<AccordionGroup>
  <Accordion title="website_overview — Get comprehensive website analytics including traffic, rankings, engagement, and traffic sources">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Website domain to analyze (e.g., "example.com" without www or protocol)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TopCountryShare": {
          "additionalProperties": false,
          "description": "A single row in the website overview's top-countries breakdown.",
          "properties": {
            "country": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Country"
            },
            "share": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Share"
            }
          },
          "title": "TopCountryShare",
          "type": "object"
        },
        "TrafficSources": {
          "additionalProperties": false,
          "description": "Traffic source share breakdown for the website overview.",
          "properties": {
            "direct": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Direct"
            },
            "referrals": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Referrals"
            },
            "search": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Search"
            },
            "social": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Social"
            },
            "mail": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Mail"
            },
            "paid_referrals": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Paid Referrals"
            }
          },
          "title": "TrafficSources",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "site_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Site Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "global_rank": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Global Rank"
        },
        "country_rank": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country Rank"
        },
        "category_rank": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category Rank"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        },
        "monthly_visits": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Monthly Visits"
        },
        "engagement_visit_duration": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engagement Visit Duration"
        },
        "engagement_pages_per_visit": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engagement Pages Per Visit"
        },
        "engagement_bounce_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engagement Bounce Rate"
        },
        "top_countries": {
          "items": {
            "$ref": "#/$defs/TopCountryShare"
          },
          "title": "Top Countries",
          "type": "array"
        },
        "traffic_sources": {
          "anyOf": [
            {
              "$ref": "#/$defs/TrafficSources"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "success"
      ],
      "title": "WebsiteOverviewOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="traffic_visits — Get total website visits over time (desktop and mobile combined)">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Website domain to analyze (e.g., "example.com" without www or protocol)
    </ResponseField>

    <ResponseField name="country" type="string">
      2-letter ISO country code (e.g., "us", "gb", "de") or "world" for worldwide data (Default: `world`)
    </ResponseField>

    <ResponseField name="granularity" type="string">
      Data granularity: daily, weekly, or monthly (Default: `monthly`)
    </ResponseField>

    <ResponseField name="start_date" type="string">
      Start date in YYYY-MM format (e.g., "2024-01")
    </ResponseField>

    <ResponseField name="end_date" type="string">
      End date in YYYY-MM format (e.g., "2024-12")
    </ResponseField>

    <ResponseField name="main_domain_only" type="boolean">
      Exclude subdomains from results
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "VisitPoint": {
          "additionalProperties": false,
          "description": "A single point in the traffic-visits time series.",
          "properties": {
            "date": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Date"
            },
            "visits": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Visits"
            }
          },
          "title": "VisitPoint",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Domain"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country"
        },
        "granularity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Granularity"
        },
        "last_updated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Updated"
        },
        "visits": {
          "items": {
            "$ref": "#/$defs/VisitPoint"
          },
          "title": "Visits",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "TrafficVisitsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="bounce_rate — Get website bounce rate over time (desktop and mobile combined)">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Website domain to analyze (e.g., "example.com" without www or protocol)
    </ResponseField>

    <ResponseField name="country" type="string">
      2-letter ISO country code (e.g., "us", "gb", "de") or "world" for worldwide data (Default: `world`)
    </ResponseField>

    <ResponseField name="granularity" type="string">
      Data granularity: daily, weekly, or monthly (Default: `monthly`)
    </ResponseField>

    <ResponseField name="start_date" type="string">
      Start date in YYYY-MM format (e.g., "2024-01")
    </ResponseField>

    <ResponseField name="end_date" type="string">
      End date in YYYY-MM format (e.g., "2024-12")
    </ResponseField>

    <ResponseField name="main_domain_only" type="boolean">
      Exclude subdomains from results
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "BounceRatePoint": {
          "additionalProperties": false,
          "description": "A single point in the bounce-rate time series.",
          "properties": {
            "date": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Date"
            },
            "bounce_rate": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Bounce Rate"
            }
          },
          "title": "BounceRatePoint",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Domain"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country"
        },
        "granularity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Granularity"
        },
        "last_updated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Updated"
        },
        "bounce_rate": {
          "items": {
            "$ref": "#/$defs/BounceRatePoint"
          },
          "title": "Bounce Rate",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "BounceRateOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="pages_per_visit — Get average pages per visit over time (desktop and mobile combined)">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Website domain to analyze (e.g., "example.com" without www or protocol)
    </ResponseField>

    <ResponseField name="country" type="string">
      2-letter ISO country code (e.g., "us", "gb", "de") or "world" for worldwide data (Default: `world`)
    </ResponseField>

    <ResponseField name="granularity" type="string">
      Data granularity: daily, weekly, or monthly (Default: `monthly`)
    </ResponseField>

    <ResponseField name="start_date" type="string">
      Start date in YYYY-MM format (e.g., "2024-01")
    </ResponseField>

    <ResponseField name="end_date" type="string">
      End date in YYYY-MM format (e.g., "2024-12")
    </ResponseField>

    <ResponseField name="main_domain_only" type="boolean">
      Exclude subdomains from results
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "PagesPerVisitPoint": {
          "additionalProperties": false,
          "description": "A single point in the pages-per-visit time series.",
          "properties": {
            "date": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Date"
            },
            "pages_per_visit": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Pages Per Visit"
            }
          },
          "title": "PagesPerVisitPoint",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Domain"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country"
        },
        "granularity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Granularity"
        },
        "last_updated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Updated"
        },
        "pages_per_visit": {
          "items": {
            "$ref": "#/$defs/PagesPerVisitPoint"
          },
          "title": "Pages Per Visit",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "PagesPerVisitOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="visit_duration — Get average desktop visit duration over time (in seconds)">
    ### Parameters

    <ResponseField name="domain" type="string" required>
      Website domain to analyze (e.g., "example.com" without www or protocol)
    </ResponseField>

    <ResponseField name="country" type="string">
      2-letter ISO country code (e.g., "us", "gb", "de") or "world" for worldwide data (Default: `world`)
    </ResponseField>

    <ResponseField name="granularity" type="string">
      Data granularity: daily, weekly, or monthly (Default: `monthly`)
    </ResponseField>

    <ResponseField name="start_date" type="string">
      Start date in YYYY-MM format (e.g., "2024-01")
    </ResponseField>

    <ResponseField name="end_date" type="string">
      End date in YYYY-MM format (e.g., "2024-12")
    </ResponseField>

    <ResponseField name="main_domain_only" type="boolean">
      Exclude subdomains from results
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "VisitDurationPoint": {
          "additionalProperties": false,
          "description": "A single point in the visit-duration time series (seconds).",
          "properties": {
            "date": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Date"
            },
            "duration_seconds": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Duration Seconds"
            }
          },
          "title": "VisitDurationPoint",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Domain"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country"
        },
        "granularity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Granularity"
        },
        "last_updated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Updated"
        },
        "average_visit_duration": {
          "items": {
            "$ref": "#/$defs/VisitDurationPoint"
          },
          "title": "Average Visit Duration",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "VisitDurationOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* Rate limits and historical data depth (typically up to 37 months) are
  determined by your Similarweb subscription tier.
* Time-series responses are scoped by `country` and `granularity`; query
  a single country or `world` per call.
* **Error model**: non-2xx responses and timeouts are caught and
  returned as `success=False` + `error` rather than raising. Plan for
  retries on the agent side based on the error string.

## Related integrations

<CardGroup cols={3}>
  <Card title="Amplitude" href="/integrations/tools/amplitude" />

  <Card title="Brandfetch" href="/integrations/tools/brandfetch" />

  <Card title="Databricks" href="/integrations/tools/databricks" />
</CardGroup>

## Links

* [Similarweb](https://www.similarweb.com)
