# Endpoints

### Fetch a stores Public Config

Mercury exposes it's grid configuration object as a store metafield

```
store.metafields.MERCURY.grid
store.metafields.MERCURY.sizemapping
store.metafields.MERCURY.colourmapping
store.metafields.MERCURY.imagemapping
```

But you can also fetch it directly from the API

{% openapi src="/files/EhHZOsmGYrmAYEchnFhH" path="/config" method="get" expanded="true" fullWidth="true" %}
[docs-json.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FmztTsXq2fUvxfs4kMagC%2Fdocs-json.json?alt=media\&token=34b89eb8-3ce7-43e4-86b0-aa3ae8670717)
{% endopenapi %}

### Search Endpoints

Mercury's core experience is our Search & Merch Engine.\
It consists of some key endpoints, which handle the heavy lifting for you to create seamless Search & Collection experiences using our embeddable experience or your own custom experience.

#### Suggest

Suggest returns a list of similar / popular search terms related to your query

{% hint style="info" %}
Available on Mercury Pro/Enterprise Plans
{% endhint %}

{% openapi src="/files/EhHZOsmGYrmAYEchnFhH" path="/suggest/{term}" method="get" expanded="true" fullWidth="true" %}
[docs-json.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FmztTsXq2fUvxfs4kMagC%2Fdocs-json.json?alt=media\&token=34b89eb8-3ce7-43e4-86b0-aa3ae8670717)
{% endopenapi %}

#### Search

Search returns a page of search results for a given search term

The engine will handle

* Synonym Matching
* Search Modifiers
* Saved Searches
* Redirects

Learn more [here](broken://pages/QYM9eo5HTodgRmbFWeOb)

{% openapi src="/files/EhHZOsmGYrmAYEchnFhH" path="/search/{term}" method="get" expanded="true" fullWidth="true" %}
[docs-json.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FmztTsXq2fUvxfs4kMagC%2Fdocs-json.json?alt=media\&token=34b89eb8-3ce7-43e4-86b0-aa3ae8670717)
{% endopenapi %}

### Collection Endpoints

Collection returns a page of collection results for a given collection query term

The engine will handle

* Sorting based on advanced rules
* Collection merchandising content
* Inline merchandising content

When constructing the grid, you will have to merge the merchandising content and the product content  to match the configuration of the store's config to allow the mercury admin preview to match the end users collection experience

Learn more [here](broken://pages/acJWd7INLlqc1MBOvUBa)

{% openapi src="/files/EhHZOsmGYrmAYEchnFhH" path="/collection/{handle}" method="get" expanded="true" fullWidth="true" %}
[docs-json.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FmztTsXq2fUvxfs4kMagC%2Fdocs-json.json?alt=media\&token=34b89eb8-3ce7-43e4-86b0-aa3ae8670717)
{% endopenapi %}

### Get Products

{% openapi src="/files/EhHZOsmGYrmAYEchnFhH" path="/search/product/{handles}" method="get" expanded="true" fullWidth="true" %}
[docs-json.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FmztTsXq2fUvxfs4kMagC%2Fdocs-json.json?alt=media\&token=34b89eb8-3ce7-43e4-86b0-aa3ae8670717)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plutocracy.io/plutocracy/mercury/endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
