# Sovrn (Viglink) module

### Getting API Key and Secret Key

To find your API key and Secret key for a site:

1. Log into the Sovrn Platform.
2. Go to Commerce > Settings > Site.
3. Under Actions, click on the Key to view the API keys for that site.
4. If no secret key has been created, click on "Generate Secret Key".

<figure><img src="/files/nwaQDac8PKBEsNTetdMS" alt=""><figcaption></figcaption></figure>

### Price comparison

The module allows you to search for a specific product in the Sovrn database and obtain all offers for that product. You simply need to provide a product URL from any supported retailer.

<figure><img src="/files/ZBBNOjKyYh1y1X2xfr6d" alt=""><figcaption></figcaption></figure>

### Price filter

Sovrn API provides a simple search function that returns all products with keywords in the product title. To find the desired product, it is recommended to add a filter by price.

<figure><img src="/files/TynKvpWPYuzYfJypkmr5" alt=""><figcaption></figcaption></figure>

### Merchnat domains

Unfortunately, the Sovrn API does not return direct product URLs or merchant domains. As a result, some merchant domains may not be detected correctly. To resolve this, add the following code to your `functions.php` file with merchant-to-domain pairs like this:

```php
function my_viglink_merchant2domain($m2d)
{
    $m2d['Verizon'] = 'verizon.com';
    $m2d['Lowe\'s'] = 'lowes.com';
    $m2d['Dell'] = 'dell.com';

    return $m2d;
}

add_filter('cegg_viglink_merchant2domain', 'my_viglink_merchant2domain');
```


---

# 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://ce-docs.keywordrush.com/modules/affiliate/viglink.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.
