Skip to main content
Autrex
Cart (0 items)
GET/api/public/v1/seo/keyword-targets

SEO Keyword Targets

Keyword-to-page mapping so storefront templates can reuse the keywords a page is meant to rank for. Two modes: pass `url` (a storefront path) to get one object for that page, or pass `page_type` to get `{ targets: [...] }` for the best pages of that type. Served by the ERP (public, read-only, non-sensitive fields only) and reachable through the same-origin storefront /api/erp proxy (base URL: {site}/api/erp). Fail-soft: a page with no mapped keywords returns `primary_keyword: null`; an unseeded page type returns an empty `targets` array. Storefront code reads it through src/lib/api/seo-keywords.ts, which validates the response and returns null on any error.

The same-origin /api/erp relay accepts only storefront allow-listed paths and methods; other routes return 404. Browser-supplied API keys are discarded. Direct public API endpoints remain available at their documented URLs.

seokeywordsrankingpage-type

Use Cases

  • Reuse the primary keyword in a page title or H1 when one is mapped
  • Pick secondary keywords for intro copy and FAQ headings
  • Audit which page types still have no keyword targets

Query Parameters

ParameterTypeRequiredDescription
urlstringOptionalStorefront path, e.g. /en-ca/brands/bosch (host, query and fragment ignored). Provide url or page_type.
localestringOptionalBCP-47 locale filter, e.g. en-CA or fr-CA. Omit for all locales.
page_typestringOptionalReturn the best pages of this type instead of one page. Provide url or page_type.
limitnumberOptionalKeywords per page (max 25)
pagesnumberOptionalpage_type mode only: maximum pages returned (max 100)
Allowed values for page_type:
homepdpcategoryvehiclevehicle_categorybrandtire_sizewheelblogguidetoollocationsaleother

Request Example

cURL
curl "https://autrex.ca/api/erp/api/public/v1/seo/keyword-targets?url=/en-ca/brands/bosch&locale=en-CA"
JavaScript
fetch("https://autrex.ca/api/erp/api/public/v1/seo/keyword-targets?url=/en-ca/brands/bosch&locale=en-CA")

Response

200url mode: { url, locale, primary_keyword, secondary_keywords[], intent, page_type }. page_type mode: { page_type, locale, targets: [same item shape] }
{
  "url": "/en-ca/brands/bosch",
  "locale": "en-CA",
  "primary_keyword": "bosch auto parts canada",
  "secondary_keywords": [
    "bosch brake pads",
    "bosch wiper blades"
  ],
  "intent": "navigational",
  "page_type": "brand"
}
400Missing or invalid parameters (neither url nor page_type, unknown page_type, malformed locale)
{
  "error": "Provide url or page_type"
}
503Temporarily unavailable. Callers must fail soft and fall back to existing copy.
{
  "error": "Provide url or page_type"
}

Caching

Max Age
300s
Stale While Revalidate
3600s