# 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="<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>" 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="<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>" 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](https://docs.plutocracy.io/plutocracy/mercury/broken-reference)

{% openapi src="<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>" 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](https://docs.plutocracy.io/plutocracy/mercury/broken-reference)

{% openapi src="<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>" 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="<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>" 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 %}
