{"_id":"57feadca4defec0e0064237c","project":"568af724176a6c0d00a29ec4","__v":6,"category":{"_id":"568af725176a6c0d00a29ec8","pages":["568af726176a6c0d00a29eca"],"project":"568af724176a6c0d00a29ec4","__v":1,"version":"568af725176a6c0d00a29ec7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-04T22:50:13.876Z","from_sync":false,"order":1,"slug":"documentation","title":"Merchant API"},"parentDoc":null,"user":"568af6d197d8960d0012ab7d","version":{"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","__v":11,"createdAt":"2016-01-04T22:50:13.289Z","releaseDate":"2016-01-04T22:50:13.289Z","categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-12T21:40:26.624Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"57717d5327a5c20e00030dbd","examples":{"codes":[{"language":"php","code":"<?php\n$ch = curl_init(\"https://rest.viglink.com/api/merchant/metadata?apiKey=e3b0bcb2925a1a09503e21df441af8aa&query=nike+running+shoes\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);"},{"code":"require 'httparty'\n\nurl = \"https://rest.viglink.com/api/merchant/metadata?apiKey=e3b0bcb2925a1a09503e21df441af8aa&query=nike+shoes\"\n\nheaders = {Authorization: \"secret YOUR SECRET KEY\"}\n\nresponse = HTTParty.get(url, headers: headers)","language":"ruby"},{"language":"curl","code":"curl -i -X GET -H \"Authorization: secret YOUR SECRET KEY\" 'https://rest.viglink.com/api/merchant/metadata?apiKey=e3b0bcb2925a1a09503e21df441af8aa&query=nike+shoes'"}]},"method":"get","results":{"codes":[{"name":"","code":"{\n    queryProfile: {\n        apiKey: \"e3b0bcb2925a1a09503e21df441af8aa\",\n        query: \"nike running shoes\"\n    },\n    items: [\n        {\n            merchantGroupId: 192,\n            name: \"Zappos\",\n            domain: \"zappos.com\",\n            logoUrl: \"https:\\/\\/images.viglink.com\\/product\\/300x126\\/[..].png\",\n            description: \"Zappos.com is an online shoe and clothing shop based in Las Vegas, Nevada. In July 2009, the company announced that Amazon.com would acquire it in an all-stock deal worth about $1.2 billion.\",\n            links: [\n                {\n                    product: \"Nike Running Anti-Blister Lightweight Low Cut Tab\",\n                    category: \"Sports and Fitness\",\n                    url: \"http:\\/\\/redirect.viglink.com\\/?u=http%3A%2F%2Fwww.zappos.com%2F[...]\",\n                    imageUrl: \"https:\\/\\/images.viglink.com\\/product\\/250x250\\/[...].jpg\"\n                },\n                {\n                    product: \"Nike - Nike Elite Running Cushion Quarter (Black\\/Wolf Grey\\/Wolf Grey) Quarter Length Socks Shoes\",\n                    category: \"Fashion\",\n                    url: \"http:\\/\\/redirect.viglink.com\\/?u=http%3A%2F%2Fwww.zappos.com%2F[...]\",\n                    imageUrl: \"https:\\/\\/images.viglink.com\\/product\\/250x250\\/[...].jpg\"\n                }\n            ]\n        },\n        {\n            merchantGroupId: 408,\n            name: \"Nordstrom\",\n            domain: \"shop.nordstrom.com\",\n            logoUrl: \"https:\\/\\/images.viglink.com\\/product\\/300x126\\/[...].png\",\n            description: \"Nordstrom, Inc. is an American chain of department stores headquartered in Seattle, Washington. Founded in 1901 by John W. Nordstrom and Carl F. Wallin, the company began as a shoe retailer and expanded its inventory to include clothing, accessories, handbags, jewelry, cosmetics, and fragrances. Select Nordstrom stores also include wedding and home furnishings departments. The company has 334 stores operating in 39 states, Puerto Rico, and Canada, which includes 121 full-line stores and 205 Nordstrom Rack stores, five Trunk Club clubhouses, two Jeffrey boutiques and one clearance store. Nordstrom also serves customers through nordstrom.com, nordstromrack.com, and its online private sale site, HauteLook. Nordstrom, Inc.'s common stock is publicly traded on the NYSE under the symbol JWN.\",\n            links: [\n                {\n                    product: \"Nike Lunarstelos Running Shoe (Men)\",\n                    category: \"Shoes\",\n                    url: \"http:\\/\\/redirect.viglink.com\\/?u=http%3A%2F%2Frover.ebay.com%2F[...]\",\n                    imageUrl: \"https:\\/\\/images.viglink.com\\/product\\/250x250\\/[...].jpg\"\n                },\n                {\n                    product: \"Nike Dri-Fit Tech Running Tights\",\n                    category: \"Clothing\",\n                    url: \"http:\\/\\/redirect.viglink.com\\/?u=http%3A%2F%2Frover.ebay.com%2F[...]\",\n                    imageUrl: \"https:\\/\\/images.viglink.com\\/product\\/250x250\\/[...].jpg\"\n                }\n            ]\n        }\n    ]\n}","language":"json","status":200},{"name":"","code":"{\n    error: {\n        errors: {\n            reason: \"invalidParameter\",\n            message: \"Your request must contain a query\",\n            locationType: \"parameter\",\n            location: \"query\"\n        }\n    },\n    code: 400,\n    message: \"Your request must contain a query\"\n}","language":"json","status":400},{"code":"{\n    error: {\n        errors: [\n            {\n                reason: \"invalidCredentials\",\n                message: \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\",\n                locationType: \"parameter\",\n                location: \"secret\"\n            }\n        ]\n    },\n    code: 401,\n    message: \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\"\n}","language":"json","status":401},{"status":403,"language":"json","code":"{\n    error: {\n        errors: {\n            reason: \"rateLimitExceeded\",\n            message: \"You need to slow down the rate at which you are sending the requests. You are only allowed 1 query per second for this endpoint\"\n        }\n    },\n    code: 403,\n    message: \"You need to slow down the rate at which you are sending the requests. You are only allowed 1 query per second for this endpoint\"\n}"},{"code":"{\n    error: {\n        errors: [\n            {\n                reason: \"internalServerError\",\n                message: \"An unexpected error occurred, but we are looking into it\"\n            }\n        ]\n    },\n    code: 500,\n    message: \"An unexpected error occurred, but we are looking into it\"\n}","language":"json","status":500}]},"auth":"required","params":[{"_id":"5801053bf9cd890f00cdea41","ref":"","in":"query","required":true,"desc":"To track clicks by campaign, use your campaign-specific API Key","default":"","type":"string","name":"apiKey"},{"_id":"5801053bf9cd890f00cdea40","ref":"","in":"query","required":true,"desc":"Search by merchant, product title or category. A general keyword will yield varied results if not relevant to consumer products. Please ensure this query is URL encoded","default":"","type":"string","name":"query"},{"_id":"58123789d2cf5b0f00a580ef","ref":"","in":"query","required":false,"desc":"The merchantGroupId can be found from the \"groupId\" property in the <a href=\"https://viglink-developer-center.readme.io/v1.0/docs/merchant-status-api\">merchant status API</a>. This is separate from the merchant id found for each returned record in the same API.","default":"","type":"array_int","name":"merchantGroupId"},{"_id":"580105a5357d0937003d405b","ref":"","in":"query","required":false,"desc":"Lowercase format of response: json or xml","default":"json","type":"string","name":"format"},{"_id":"580105a5357d0937003d405a","ref":"","in":"query","required":false,"desc":"JSON-P callback method name for JSON format requests","default":"","type":"string","name":"callback"}],"url":"/merchant/metadata"},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Authorization Header\",\n  \"body\": \"You must add authorization headers to this request.\\n```Authorization: secret {SECRET KEY}```\\n\\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\\\" on any of your campaigns.\"\n}\n[/block]","excerpt":"Get back products trending by clicks or revenue within the last 30 days","slug":"merchant-metadata","type":"endpoint","title":"Merchant Metadata"}

getMerchant Metadata

Get back products trending by clicks or revenue within the last 30 days

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

apiKey:
required
string
To track clicks by campaign, use your campaign-specific API Key
query:
required
string
Search by merchant, product title or category. A general keyword will yield varied results if not relevant to consumer products. Please ensure this query is URL encoded
merchantGroupId:
array of integers
The merchantGroupId can be found from the "groupId" property in the <a href="https://viglink-developer-center.readme.io/v1.0/docs/merchant-status-api">merchant status API</a>. This is separate from the merchant id found for each returned record in the same API.
format:
stringjson
Lowercase format of response: json or xml
callback:
string
JSON-P callback method name for JSON format requests

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Authorization Header", "body": "You must add authorization headers to this request.\n```Authorization: secret {SECRET KEY}```\n\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\" on any of your campaigns." } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}