Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Semrush

Scalekit connector
Open markdown

The Semrush connector lets your AI agent act in each user's Semrush account. Each user connects their own Semrush API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 54 tools.

Tools
54
What they doRead · write · destructive
35 · 14 · 535 read14 write5 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Semrush connection

    In AgentKit > Connections, create a Semrush connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'semrush'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Semrush:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'semrush_get_map_rank_limits',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Semrush credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • semrush_get_authority_score_distributionGet the distribution of a target's referring domains by authority score (0 to 100).Read-only

    Get Authority Score Distribution

    Get the distribution of a target's referring domains by authority score (0 to 100). Returns up to 101 rows of domain_score and domains_count, omitting scores with no domains. Use it to judge link quality; use list_referring_domains for the domains behind each score. Costs 1 API unit per returned row.

    Inputs

    scopestringrequired
    Which part of the target to analyze: ROOT_DOMAIN, SUBDOMAIN, SUBFOLDER, PAGE. ROOT_DOMAIN covers the whole domain and its subdomains; PAGE covers one exact URL.one of ROOT_DOMAINSUBDOMAINSUBFOLDERPAGE
    urlstringrequired
    Domain, subdomain, subfolder or full page URL to analyze, with or without protocol (max 2000 characters). It must match the chosen scope. Example: example.com.
  • semrush_get_gbp_metricsGet Google Business Profile performance metrics (views, searches, website clicks, direction requests, call clicks) for 1 to 5 locations over a date range, aggregated daily, weekly or monthly and as period totals, plus the average GBP review rating.Read-only

    Get GBP Metrics

    Get Google Business Profile performance metrics (views, searches, website clicks, direction requests, call clicks) for 1 to 5 locations over a date range, aggregated daily, weekly or monthly and as period totals, plus the average GBP review rating. Locations must be connected to GBP. Pass at least one of aggregated_metrics or total_metrics.

    Inputs

    date_fromstringrequired
    Start date, YYYY-MM-DD, within the last 24 months. Example: 2024-01-01.
    date_tostringrequired
    End date, YYYY-MM-DD, within the last 24 months. Example: 2024-12-01.
    location_idsstringrequired
    Comma-separated IDs of 1 to 5 locations, from list_locations. Example: 1d21ceab55d740709311ec9b8a12c01e,2c32dfbc66e851820422fd9c9b23d12f.
    aggregated_metricsstring
    Comma-separated metrics to return per period: ALL_ACTION, MAPS_VIEWS, SEARCH_VIEWS, TOTAL_VIEWS, BUSINESS_IMPRESSIONS_MOBILE_SEARCH, BUSINESS_IMPRESSIONS_DESKTOP_SEARCH, BUSINESS_IMPRESSIONS_MOBILE_MAPS, BUSINESS_IMPRESSIONS_DESKTOP_MAPS, WEBSITE_CLICKS, BUSINESS_DIRECTION_REQUESTS, CALL_CLICKS. Example: MAPS_VIEWS,WEBSITE_CLICKS.
    aggregation_modestring
    Period for aggregated_metrics: DAILY, WEEKLY or MONTHLY. The API default is DAILY.one of DAILYWEEKLYMONTHLY
    total_metricsstring
    Comma-separated metrics to return as totals for the whole range: TOTAL_VIEWS, TOTAL_MAPS_VIEWS, TOTAL_SEARCH_VIEWS, TOTAL_MOBILE_SEARCH_VIEWS, TOTAL_DESKTOP_SEARCH_VIEWS, TOTAL_MOBILE_MAPS_VIEWS, TOTAL_DESKTOP_MAPS_VIEWS, TOTAL_ACTION, TOTAL_WEBSITE_CLICKS_ACTION, TOTAL_BUSINESS_DIRECTION_REQUESTS_ACTION, TOTAL_CALL_CLICKS_ACTION. Example: TOTAL_VIEWS,TOTAL_WEBSITE_CLICKS_ACTION.
  • semrush_get_keyword_metricsGet search metrics for one keyword in one country: monthly search volume, keyword difficulty, CPC in USD cents, competitive density, search intents, SERP features, number of results and a 12-month interest trend.Read-only

    Get Keyword Metrics

    Get search metrics for one keyword in one country: monthly search volume, keyword difficulty, CPC in USD cents, competitive density, search intents, SERP features, number of results and a 12-month interest trend. Use it to size and compare keywords one at a time. Costs 20 API units per request.

    Inputs

    countrystringrequired
    Two-letter ISO 3166-1 country code of the Google database to use (the United Kingdom is UK, not GB). Example: US.one of AFALDZAOARAMAUATAZBSBHBDBYBEBZBOBABWBRBNBGKHCMCACVCLCOCRHRCYCZCDDKDOECEGSVEEETFIFRGEDEGHGRGTGYHTHNHKHUISINIDIEILITJMJPJOKZKWLVLBLYLTLUMGMYMTMUMXMDMNMEMAMZNANPNLNZNINGNOOMPKPAPYPEPHPLPTQARORUSASNRSSGSKSIZAKRESLKSECHTWTHTTTNTRUAAEUKUSUYVEVNZMZW
    keywordstringrequired
    The keyword or phrase to analyze, 1 to 255 characters. Example: seo tools.
    monthstring
    Monthly snapshot to return, formatted YYYY-MM, from 2012-01 up to the current month. The API default is the current month. Example: 2024-01.
  • semrush_get_locationGet one business location with its address, contact details, hours, categories, status (COMPLETED, PROCESSING or FAILED), frozen flag and any errors.Read-only

    Get Location

    Get one business location with its address, contact details, hours, categories, status (COMPLETED, PROCESSING or FAILED), frozen flag and any errors. Use it to confirm a create or update finished; use list_locations to find IDs.

    Inputs

    location_idstringrequired
    32-character hex ID of the Local location. Find it with list_locations. Example: 1d21ceab55d740709311ec9b8a12c01e.