{
  "openapi": "3.0.1",
  "info": {
    "title": "Semrush Scraper - Traffic, Authority, Backlinks & Keywords",
    "description": "Scrape Semrush public website overviews: monthly visits, Authority Score, global/country/category rank, organic vs paid traffic, backlinks, referring domains, top keywords with CPC, competitors, traffic by country, device split and AI-assistant referrals.",
    "version": "0.1",
    "x-build-id": "UNjaOFf7GhaRvY4EZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~semrush-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-semrush-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/scrapesage~semrush-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-semrush-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/scrapesage~semrush-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-semrush-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "Domains to analyse, one per line - e.g. <code>booking.com</code>, <code>stripe.com</code>, <code>bbc.co.uk</code>. Full URLs and Semrush overview links are accepted too and reduced to the registrable domain. Semrush only publishes an overview for domains above a traffic threshold; anything below it is reported as <i>not covered</i> and is never charged.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Semrush overview URLs",
            "type": "array",
            "description": "Paste Semrush overview URLs directly, e.g. <code>https://www.semrush.com/website/booking.com/overview/</code>. <b>Bulk import:</b> use this field's <i>Link remote text file</i> option to load a hosted list (one entry per line) - or paste the list into <b>Import domains from a file</b> below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "urlsFromFile": {
            "title": "Import domains from a file (one per line)",
            "type": "string",
            "description": "Bulk-load domains without adding them one at a time. Two ways to use it: <b>(1)</b> paste your whole list straight in, one domain per line - open your .txt/.csv, select all, paste; or <b>(2)</b> give a single link to the file and it is downloaded for you - a public <code>.txt</code>/<code>.csv</code>, a Google Sheet or Drive share link (auto-converted to CSV export), or an Apify key-value-store record. Blank lines, <code>#</code> comments and extra CSV columns are ignored, and duplicates are only analysed once. If the file cannot be read the run says so and charges nothing."
          },
          "includeHistory": {
            "title": "Include history series",
            "type": "boolean",
            "description": "Add the month-by-month series: visits, organic vs paid search traffic, backlinks and referring domains (up to 6 months each).",
            "default": true
          },
          "includeKeywords": {
            "title": "Include top organic keywords",
            "type": "boolean",
            "description": "Add the domain's top organic keywords with position, monthly search volume, CPC and share of traffic.",
            "default": true
          },
          "includeCompetitors": {
            "title": "Include organic competitors",
            "type": "boolean",
            "description": "Add the competing domains Semrush ranks against this one, with a relevance score and their monthly visits.",
            "default": true
          },
          "includeCountries": {
            "title": "Include traffic by country",
            "type": "boolean",
            "description": "Add the top countries sending traffic, each with its traffic share and desktop/mobile split.",
            "default": true
          },
          "includeAiTraffic": {
            "title": "Include AI-assistant traffic",
            "type": "boolean",
            "description": "Add referral traffic coming from AI assistants (ChatGPT, Perplexity and friends) with volume and share - the newest signal on the page and the one most competitors do not export.",
            "default": true
          },
          "includeDevices": {
            "title": "Include desktop/mobile split",
            "type": "boolean",
            "description": "Add the desktop vs mobile visit counts and their month-by-month history.",
            "default": true
          },
          "includeReferrals": {
            "title": "Include referral in/out flows",
            "type": "boolean",
            "description": "Add the sites sending traffic TO this domain and the sites it sends traffic to, with share and volume.",
            "default": true
          },
          "outputFields": {
            "title": "Output fields (leave empty for all)",
            "type": "array",
            "description": "Pick the fields you want and every record is trimmed to exactly those - handy for lean CSV/Sheets exports. <b>Nothing to memorise:</b> open the dropdown and tick, or start typing (<code>traffic</code>, <code>rank</code>, <code>backlink</code>) to filter. Leave empty to get every field.",
            "items": {
              "type": "string",
              "enum": [
                "type",
                "domain",
                "url",
                "brandName",
                "country",
                "categories",
                "favicon",
                "authorityScore",
                "googlePenaltyRisk",
                "globalRank",
                "globalRankTrend",
                "countryRank",
                "countryRankCode",
                "countryRankName",
                "countryRankTrend",
                "categoryRank",
                "categoryRankName",
                "visits",
                "visitsChangePercent",
                "pagesPerVisit",
                "timeOnSiteSec",
                "bounceRate",
                "organicTraffic",
                "organicChangePercent",
                "paidTraffic",
                "paidChangePercent",
                "backlinks",
                "backlinksChangePercent",
                "referringDomains",
                "referringDomainsChangePercent",
                "desktopVisits",
                "mobileVisits",
                "desktopShare",
                "mobileShare",
                "topCountry",
                "countriesCovered",
                "competitorCount",
                "aiTrafficTotal",
                "aiTrafficShare",
                "visitsHistory",
                "searchTrafficHistory",
                "backlinksHistory",
                "referringDomainsHistory",
                "trafficByCountry",
                "deviceHistory",
                "topKeywords",
                "competitors",
                "aiTraffic",
                "referralsIn",
                "referralsOut",
                "dataDate",
                "dateModified",
                "scrapedAt"
              ],
              "enumTitles": [
                "Record type (type)",
                "Domain (domain)",
                "Semrush URL (url)",
                "Brand name (brandName)",
                "Country (country)",
                "Categories (categories)",
                "Favicon (favicon)",
                "Authority Score (authorityScore)",
                "Google penalty risk (googlePenaltyRisk)",
                "Global rank (globalRank)",
                "Global rank trend (globalRankTrend)",
                "Country rank (countryRank)",
                "Country rank code (countryRankCode)",
                "Country rank country (countryRankName)",
                "Country rank trend (countryRankTrend)",
                "Category rank (categoryRank)",
                "Category name (categoryRankName)",
                "Monthly visits (visits)",
                "Visits change % (visitsChangePercent)",
                "Pages per visit (pagesPerVisit)",
                "Time on site, seconds (timeOnSiteSec)",
                "Bounce rate (bounceRate)",
                "Organic search traffic (organicTraffic)",
                "Organic change % (organicChangePercent)",
                "Paid search traffic (paidTraffic)",
                "Paid change % (paidChangePercent)",
                "Backlinks (backlinks)",
                "Backlinks change % (backlinksChangePercent)",
                "Referring domains (referringDomains)",
                "Referring domains change % (referringDomainsChangePercent)",
                "Desktop visits (desktopVisits)",
                "Mobile visits (mobileVisits)",
                "Desktop share (desktopShare)",
                "Mobile share (mobileShare)",
                "Top country (topCountry)",
                "Countries covered (countriesCovered)",
                "Competitor count (competitorCount)",
                "AI traffic total (aiTrafficTotal)",
                "AI traffic share (aiTrafficShare)",
                "Visits history (visitsHistory)",
                "Organic/paid history (searchTrafficHistory)",
                "Backlinks history (backlinksHistory)",
                "Referring domains history (referringDomainsHistory)",
                "Traffic by country (trafficByCountry)",
                "Desktop/mobile history (deviceHistory)",
                "Top organic keywords (topKeywords)",
                "Organic competitors (competitors)",
                "AI-assistant traffic (aiTraffic)",
                "Referrals in (referralsIn)",
                "Referrals out (referralsOut)",
                "Data date (dataDate)",
                "Date modified (dateModified)",
                "Scraped at (scrapedAt)"
              ]
            }
          },
          "maxItems": {
            "title": "Max domains",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of domains to analyse in one run. Pagination stops automatically when this is reached.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Semrush serves these public pages cleanly to Apify datacenter proxies, which are used by default. If you ever see blocks, switch to Residential.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}