semrush cli

On Page SEO Checker

Assign landing pages and target keywords, run analysis, and inspect optimization recommendations.

On Page SEO Checker evaluates landing pages against top SERP competitors to generate actionable optimization ideas, page details, and competitor SERP comparisons.

Setup and campaign creation

Operations require a numeric SEO project identifier (campaign_id). Verify allowances before creating a configuration:

semrush onpage-campaigns --json
semrush onpage-limits --campaign-id 12345678 --json
semrush onpage-settings --campaign-id 12345678 --json

Initialize an unconfigured project by assigning landing pages and target keywords:

semrush onpage-create --campaign-id 12345678 \
  --landings '[{"url":"https://example.com/docs","keywords":["documentation framework"]}]' \
  --confirm

Creation saves the target landing pairs without immediately starting an analysis run. Each landing requires an absolute HTTP(S) URL and a non-empty array of keywords. A keyword can belong to only one landing page per campaign.

Starting analysis and reading results

Initiate an analysis run:

semrush onpage-run --campaign-id 12345678 --confirm --json

Monitor progress and inspect overview metrics:

semrush onpage-info --campaign-id 12345678 --json
semrush onpage-overview --campaign-id 12345678 --json
semrush onpage-progress --campaign-id 12345678 --json
semrush onpage-pages --campaign-id 12345678 --json

The onpage-pages response includes all configured URLs as well as the native ORPHANS row. Copy a page's string id and nested snapshot.id to inspect its recommendations.

Granular page recommendations

Replace the example page and snapshot IDs with the 24-character hexadecimal IDs from your results:

semrush onpage-page-ideas --campaign-id 12345678 \
  --page-id '0123456789abcdef01234567' --snapshot-id '89abcdef0123456701234567' --json

semrush onpage-page-keywords --campaign-id 12345678 \
  --page-id '0123456789abcdef01234567' --snapshot-id '89abcdef0123456701234567' --json

semrush onpage-page-details --campaign-id 12345678 \
  --page-id '0123456789abcdef01234567' --snapshot-id '89abcdef0123456701234567' \
  --detail length --json

Accepted --detail options for onpage-page-details: density, related, backlinks, length, video, and readability.

Inspect competitor SERP details for a specific keyword on that page:

semrush onpage-page-keyword-details --campaign-id 12345678 \
  --page-id '0123456789abcdef01234567' --snapshot-id '89abcdef0123456701234567' \
  --detail serp --keyword 'documentation framework' --json

Updating campaign settings and pages

Modify general scheduling, crawlers, or geographic targeting:

semrush onpage-configure --campaign-id 12345678 --schedule weekly --crawler googlebot --confirm --json
semrush onpage-location-set --campaign-id 12345678 --country-code us --location 'United States' --device desktop --confirm --json

Partial updates preserve omitted fields.

Modifying landing pages and keywords

semrush onpage-page-add --campaign-id 12345678 \
  --url https://example.com/features --keywords '["cli tools"]' --confirm

semrush onpage-page-update --campaign-id 12345678 \
  --page-id '0123456789abcdef01234567' \
  --url https://example.com/pricing --keywords '["software pricing"]' \
  --confirm

semrush onpage-pages-delete --campaign-id 12345678 \
  --page-ids '["0123456789abcdef01234567"]' --confirm

To re-analyze a single updated landing page without running the full campaign:

semrush onpage-page-run --campaign-id 12345678 --page-id '0123456789abcdef01234567' --confirm

On this page