Obtain an API key from your Semrush account under Subscription > API and note your monthly API unit balance
Construct a GET request to the Semrush API base URL (api.semrush.com) with query parameters: type (the report type, e.g., domain_organic), key (your API key), domain, database (regional database code such as us or uk), and export_columns
Set export_columns to a comma-separated list of the fields you need (e.g., Ph,Po,Nq,Cp for keyword, position, search volume, CPC) to reduce response size and unit consumption
Parse the tab-separated response body; the first row contains column headers and subsequent rows contain data records
For keyword research reports, use the phrase_related or phrase_fullsearch report types with a keyword parameter instead of a domain parameter
Known gotchas
Each API call deducts units from your monthly balance at a rate that varies by report type and row count; high-volume bulk exports can exhaust monthly units quickly if not rate-limited
The database parameter selects the regional index; querying the wrong regional database returns data for the wrong market — there is no global combined database, so cross-regional analysis requires separate queries per database
Semrush data has a refresh cadence that varies by report; position data may lag by several days to a week, making it unsuitable for real-time rank tracking
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp