Parse a store URL
Turn any store URL into the fields the other endpoints take: whether it points at a product, a collection or the store itself, plus the domain, the canonical store URL, the handle, the selected variant id and the permanent myshopify domain. It makes no request to the store, so it is the cheap way to find out what a pasted URL is before spending a request on it. Parsing a URL does not consume a credit.
/resolve-url Utility https://api.fetchlayer.dev/shopify-stores/resolve-url Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
url string required Any store URL, to be parsed into structured fields.
format string optional json or markdown. Markdown returns the same result rendered for a model to read. (default: json)
timeoutMs number optional Per-request time limit in milliseconds (max 120000).
Response Fields
resolve-url
Parse a store URL
kind string What the URL points at: product, collection, store, or unknown.
url string The URL that was parsed.
domain string The store domain carried in the URL.
storeUrl string The canonical store URL to pass as store elsewhere.
targetUrl string The canonical URL of the product or collection the URL points at.
handle string The product or collection handle, when the URL carries one.
variantId string The variant selected in the URL query string, when there is one.
permanentDomain string The myshopify.com domain, when the URL is one.
Request
curl -X POST "https://api.fetchlayer.dev/shopify-stores/resolve-url" \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"url":"https://allbirds.com/products/mens-tree-runners?variant=39812345678901"}'Response
{
"kind": "product",
"domain": "allbirds.com",
"storeUrl": "https://allbirds.com",
"handle": "mens-tree-runners",
"variantId": "39812345678901",
"permanentDomain": null
}