API Implementation with Commerce
Note: Please find complete documentation for all Sovrn Commerce APIs here.
All sites/apps/toolbars/etc. that you hope to use will need to be approved by Sovrn's Network Quality team in order for you to affiliate with our merchant partners.
How to find your site's API key and Secret key
Both your site API key and your Secret key can be found on the Settings page of your Sovrn Commerce account. Each row of sites has a column of Actions. Click on the “Key” icon under the Actions column to show the associated API key for a given site. Here, you will also have the option to generate a Secret key, which will enable you to call Sovrn’s Commerce APIs.
Note: Your Secret key can be used to pull all of your account data, and you will not need a secret key for each of your sites. When using the Secret Key with the Sovrn Commerce APIs, use the word "secret" along with your secret key. That is, "secret 1234" rather than just "1234". You can read more about authorization here.
How to find your site ID
If you are connecting your Sovrn account to a reporting tool, you may need to access your site ID, also referred to as your campaign ID.
Your site/campaign ID can be found from the Settings page. Click on the “Gear” icon under the Actions column to show the associated API key for a given site. Once you’ve clicked this icon, review the URL on your browser’s address bar. The URL should look something like this: https://platform.sovrn.com/commerce/settings/site?flyoutOpen=settings&tab=approved&selectedSite=XXXXXXX
The numbers that are replaced by the XXXXXXX
are your site/campaign ID.
Are there rate limits for any of the APIs?
Please check the complete API documentation for more information. Here are the rate limits currently in place:
All APIs under the “Commerce Real Time Reports” section: 1 request every 60 seconds
All APIs under the “Commerce Merchants” section: 1 request every 10 seconds
API Key Limit: 30,000 requests per 5 minutes
IP-Based Limit: 100 requests per 5 minutes per IP address
Price Comparison (Affiliated) API: 100 requests every 1 second
Aliasing Sovrn Commerce API Calls
If you’d like to mask your usage of Sovrn Commerce's affiliation services, you can create "alias" domains for Sovrn's service-related hostnames and make a slight modification to your Sovrn JavaScript library initialization parameters.
Any publisher can alias the API calls by creating a single CNAME and redirecting Sovrn API calls to that name. To create the appearance that a page on your website calls publisher-provided services instead of Sovrn Commerce's service, use the following guidelines:
Create a DNS CNAME that points to
api.viglink.com
. We suggest using:click.<publisherdomain>.com
Change the
api_url
parameter in the Sovrn Javascript library initialization code on your pages to specify the alias domain name.
An example altered initialization block is shown below:
<script type="text/javascript">
var vglnk = {
api_url: '//click.mydomain.com/api',
key: 'mypublisherkey'
};
(function(d, t) {
var s = d.createElement(t);
s.type = 'text/javascript';
s.async = true;
s.src = ('https:' == document.location.protocol ? vglnk.api_url : '//cdn.viglink.com/api') + '/vglnk.js';
var r = d.getElementsByTagName(t)[0];
r.parentNode.insertBefore(s, r);
}(document, 'script'));
</script>
A Note About SSL
These instructions apply primarily to non-SSL traffic. Aliasing SSL (https) traffic is more complex because of the security protocols involved. Sovrn does not currently support aliasing its hostnames for SSL traffic.
If your site supports SSL, the code snippet below will function; however, viewers accessing your site via SSL will see warnings in their browser.
<script type="text/javascript">
var vglnk = {
api_url: '//click.mydomain.com/api',
key: 'mypublisherkey'
};
(function(d, t) {
var s = d.createElement(t);
s.type = 'text/javascript';
s.async = true;
s.src = ('https:' == document.location.protocol ? vglnk.api_url : '//cdn.viglink.com/api') + '/vglnk.js';
var r = d.getElementsByTagName(t)[0];
r.parentNode.insertBefore(s, r);
}(document, 'script'));
</script>
How can I easily test out a Commerce API?
With most of our API Documentation pages, there will be a "Try It!" section that enables you to test what a call to the respective API looks like. In these sections – which require zero coding – you can test to see exactly what information will be provided, try out different filters or parameters, and of course, view the call’s result itself. This is an excellent tool to explore the different APIs we offer before you may decide which is the right API for your needs.
In order to use this “Try It!" section, you’ll usually need your Secret key to authenticate. The above section “How to find your site's API key and Secret key” can walk you through how to find your Secret key.
Warning: the Secret key is like a password and should not be shared.
Below is an example of utilizing this “Try It!" section with Sovrn’s Transactions API documentation. To the right of the page, you’ll see the Authorization header. This is where you’ll need to place your secret key in the format: secret {SECRET KEY}

Scroll down the page and you'll see the Query Params section. You can fill out these parameter fields and click “Try It!” to get an example response.

I still need help.
If you still need help, please check the complete API documentation here, or reach out to Sovrn Support.