/api/public/v1/seo/keyword-targetsSEO 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.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Optional | Storefront path, e.g. /en-ca/brands/bosch (host, query and fragment ignored). Provide url or page_type. |
locale | string | Optional | BCP-47 locale filter, e.g. en-CA or fr-CA. Omit for all locales. |
page_type | string | Optional | Return the best pages of this type instead of one page. Provide url or page_type. |
limit | number | Optional | Keywords per page (max 25) |
pages | number | Optional | page_type mode only: maximum pages returned (max 100) |
homepdpcategoryvehiclevehicle_categorybrandtire_sizewheelblogguidetoollocationsaleotherRequest Example
curl "https://autrex.ca/api/erp/api/public/v1/seo/keyword-targets?url=/en-ca/brands/bosch&locale=en-CA"fetch("https://autrex.ca/api/erp/api/public/v1/seo/keyword-targets?url=/en-ca/brands/bosch&locale=en-CA")Response
{
"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"
}{
"error": "Provide url or page_type"
}{
"error": "Provide url or page_type"
}Caching
- Max Age
- 300s
- Stale While Revalidate
- 3600s