Get sitemap data
const url = 'https://apibase.ecomweb.app/api/v1/storefront/stores/example/sitemap-data';const options = {method: 'GET', headers: {'x-storefront-api-key': '<x-storefront-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/storefront/stores/example/sitemap-data \ --header 'x-storefront-api-key: <x-storefront-api-key>'Returns everything a sitemap lists in one response: published content pages, published blog posts, blog categories and tags, active collections and active products on the online store. Every list is empty while the store is coming soon. Each entry carries only what a sitemap needs: the slug and updated_at, and the page_type of a content page.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s reference.
Responses
Section titled “Responses”object
Published content pages.
object
When it was last updated, as an ISO 8601 timestamp, or null.
The page’s type, such as about, contact or faq, or null.
URL slug.
Published blog posts, newest first.
object
When it was last updated, as an ISO 8601 timestamp, or null.
URL slug.
Blog categories.
object
When it was last updated, as an ISO 8601 timestamp, or null.
URL slug.
Blog tags.
object
When it was last updated, as an ISO 8601 timestamp, or null.
URL slug.
Active collections.
object
When it was last updated, as an ISO 8601 timestamp, or null.
URL slug.
Active products that are listed on the online store.
object
When it was last updated, as an ISO 8601 timestamp, or null.
URL slug.
Example generated
{ "content_pages": [ { "updated_at": "example", "page_type": "example", "slug": "example" } ], "blog_posts": [ { "updated_at": "example", "slug": "example" } ], "blog_categories": [ { "updated_at": "example", "slug": "example" } ], "blog_tags": [ { "updated_at": "example", "slug": "example" } ], "collections": [ { "updated_at": "example", "slug": "example" } ], "products": [ { "updated_at": "example", "slug": "example" } ]}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route or on a Storefront route that needs a secret key, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The resource does not exist in this store.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}