{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/coupons","auth":"required","method":"get","results":{"codes":[{"status":200,"language":"json","code":"results: [\n\t{\n\tcouponId: \"1cd1d2a9082824c26a9832315a0de357\",\n\ttitle: \"FREE Cuisinart 6 Qt Pressure Cooker when you spend $1500 with code QL5GFT25    (excludes HP) at Quill.com\",\n\tdescription: \"FREE Cuisinart 6 Qt Pressure Cooker when you spend $1500 with code QL5GFT25 (excludes HP) at Quill.com\",\n\tpromoCode: \"QL5GFT25\",\n\turl: \"https://redirect.viglink.com?key=123456789&u=https%3A%2F%2Fwww.quill.com%2Fmcode%2Fmcode.aspx%3Fm%3DAFF_CJ_SW_FG2_5600%26u%3D%252fcoupon-codes%252fcbx%252f327.html%253fcm_mmc%253dAFF_CJ_SW_FG2_5600&type=CP\",\n\tstartDate: \"2019-02-03\",\n\tendDate: \"2019-04-07\",\n\tmerchantLogo: \"https://images.viglink.com/merchant/logo/official/240x120/quill/f854893e79d8bb364ce7378b86a248235d9b73bc.jpg?url=http%253A%252F%252Fwww.viglink.com%252Fmerchants%252F2820.gif&text=Quill\",\n\tmerchantName: \"Quill.com\",\n\tmerchantDomain: \"quill.com\",\n\tmerchantGroupId: 2820\n\t},\n      {...}\n    ],\n  \"pagination\": {\n        \"page\": 0,\n        \"perPage\": 3000,\n        \"totalItems\": 176\n    }\n}\n      \n      ","name":""},{"status":422,"language":"json","code":"{\n    \"message\": \"That request was invalid\",\n    \"errors\": [\n        {\n            \"resource\": \"Coupon Controller\",\n            \"field\": \"getCoupons\",\n            \"code\": \"invalid\",\n            \"message\": \"Please provide either merchant domain or merchant group id only\"\n        }\n    ],\n    \"timestamp\": 1554239962379\n}","name":""},{"code":"\"couponId\",\"title\",\"description\",\"promoCode\",\"url\",\"startDate\",\"endDate\",\"merchantName\",\"merchantLogo\",\"merchantDomain\",\"merchantGroupId\"\n\"3617db1abb680a75e1a76652a44ac086\",\"55% off for ILIFE X432 Intelligent Robot Vacuum Cleaner(450ML High Capacity)\",\"55% off for ILIFE X432 Intelligent Robot Vacuum Cleaner(450ML High Capacity) at Tomtop Technology Co. ,Ltd..\",,\"https://redirect.viglink.com?key=60c2c628bc8f257d6bbe2a1ea678f5db&u=https%3A%2F%2Fwww.tomtop.com%2Fp-jd0002us.html%3Fusource%3Dlc%26utm_source%3DLinkconnector&type=CP\",\"2019-03-13\",\"2019-04-30\",\"tomtop.com\",\"https://images.viglink.com/merchant/logo/official/240x120/tom-top/1562f49880d8bd9a4a22beb86f0030ad388e225c.jpg?url=http%253A%252F%252Fwww.viglink.com%252Fmerchants%252F25938.gif&text=Tom%2BTop\",\"tomtop.com\",\"25938\"\n\"198a27f884358b42b19177bae2dd5fae\",\"37% off for Professional LCD Digital Anemometer with Flashlight\",\"37% off for Professional LCD Digital Anemometer with Flashlight at Tomtop Technology Co. ,Ltd..\",,\"https://redirect.viglink.com?key=60c2c628bc8f257d6bbe2a1ea678f5db&u=https%3A%2F%2Fwww.tomtop.com%2Fp-e5556.html%3Fusource%3Dlc%26utm_source%3DLinkconnector&type=CP\",\"2019-03-13\",\"2019-04-30\",\"tomtop.com\",\"https://images.viglink.com/merchant/logo/official/240x120/tom-top/1562f49880d8bd9a4a22beb86f0030ad388e225c.jpg?url=http%253A%252F%252Fwww.viglink.com%252Fmerchants%252F25938.gif&text=Tom%2BTop\",\"tomtop.com\",\"25938\"\n...","language":"text","status":200,"name":"in csv"},{"status":401,"language":"json","code":"  {\n    \"error\": \"Unauthorized\",\n    \"message\": \"No message available\",\n    \"path\": \"/coupons\",\n    \"status\": 401,\n    \"timestamp\": 1554241718655\n}"}]},"settings":"587568fccf38030f005e3f39","examples":{"codes":[{"language":"php","code":"<?php\n$ch = curl_init(\"https://viglink.io/coupons?startDate=2019-03-13&apiKey=123456789&domain=tomtop.com\");\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);"},{"language":"ruby","code":"require 'httparty'\n\nurl = \"https://viglink.io/coupons?startDate=2019-03-13&domain=tomtop.com\"\n\nheaders = {Authorization: \"secret {SECRET KEY}\"}\n\nresponse = HTTParty.get(url, headers: headers)"},{"language":"curl","code":"curl -i -X GET -H \"Authorization: secret {SECRET KEY}\" \n'https://viglink.io/coupons?startDate=2019-03-13&domain=tomtop.com'"}]},"params":[{"name":"domain","type":"string","default":"","desc":"Get coupons valid for a specified domain. Cannot work with parameter: merchantGroupId at the same time","required":false,"in":"query","ref":"","_id":"58756dd5cf38030f005e3f6c"},{"name":"merchantGroupId","type":"string","default":"","desc":"Get coupons valid for a specified merchantGroupId. Cannot work with parameter: domain at the same time","required":false,"in":"query","ref":"","_id":"58756dd5cf38030f005e3f6b"},{"name":"startDate","type":"string","default":"","desc":"Get coupons that are valid greater than or equal to the startDate specified. Format: yyyy-mm-dd. e.g. 2019-02-06. The startDate cannot be in the future.","required":false,"in":"query","ref":"","_id":"58756dd5cf38030f005e3f6a"},{"name":"format","type":"string","default":"json","desc":"This changes the format of the response. We currently support 'json', 'csv' and 'clipper'. 'clipper' exports a csv that is compatible with the popular Clipper wordpress coupon plugin: https://www.appthemes.com/themes/clipper/","required":false,"in":"query","ref":"","_id":"58756dd5cf38030f005e3f69"}]},"next":{"description":"","pages":[]},"title":"Coupons (Beta)","type":"endpoint","slug":"coupons","excerpt":"This API is in beta, and is subject to change","body":"Export thousands of active coupons from our growing list of supported networks and retailers. This API is rate limited and coupons are updated daily. The suggested usage is to perform a daily export of the data to be ingested into your own system. \n[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]\nFAQ:\nQ: How can I test this in my web browser?\nA: You can download a browser extension called mod header here: \n\nhttps://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=de\n\nThe extension allows you to add a secret key to your request. Under the \"Value\" section in the plugin, paste \"secret 1234abcd\" without quotes, and replace the 1234abcd with one of the secret keys from your VigLink account. You can find your secret key in your site settings page: \n\nhttps://publishers.viglink.com/publisher/sites\n\nNow you can test the API by making a request with your web browser. \n\n\nWhen you are done testing be sure to disable the mod header extension as it can interfere with browsing websites.","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5ca4fa37512269005c9063a5","project":"568af724176a6c0d00a29ec4","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8","5ca3c2274439e800149daf96"],"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","releaseDate":"2016-01-04T22:50:13.289Z","__v":12,"createdAt":"2016-01-04T22:50:13.289Z"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Beta","slug":"viglinkio-internal-hidden","order":8,"from_sync":false,"reference":false,"_id":"587569b6f4483a0f00d2e6b8","version":"568af725176a6c0d00a29ec7","createdAt":"2017-01-10T23:09:42.598Z","project":"568af724176a6c0d00a29ec4","__v":0},"user":"568af6d197d8960d0012ab7d","createdAt":"2019-04-03T18:23:51.121Z","__v":17,"parentDoc":null}

getCoupons (Beta)

This API is in beta, and is subject to change

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

domain:
string
Get coupons valid for a specified domain. Cannot work with parameter: merchantGroupId at the same time
merchantGroupId:
string
Get coupons valid for a specified merchantGroupId. Cannot work with parameter: domain at the same time
startDate:
string
Get coupons that are valid greater than or equal to the startDate specified. Format: yyyy-mm-dd. e.g. 2019-02-06. The startDate cannot be in the future.
format:
stringjson
This changes the format of the response. We currently support 'json', 'csv' and 'clipper'. 'clipper' exports a csv that is compatible with the popular Clipper wordpress coupon plugin: https://www.appthemes.com/themes/clipper/

Examples


Result Format


Documentation

Export thousands of active coupons from our growing list of supported networks and retailers. This API is rate limited and coupons are updated daily. The suggested usage is to perform a daily export of the data to be ingested into your own system. [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] FAQ: Q: How can I test this in my web browser? A: You can download a browser extension called mod header here: https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=de The extension allows you to add a secret key to your request. Under the "Value" section in the plugin, paste "secret 1234abcd" without quotes, and replace the 1234abcd with one of the secret keys from your VigLink account. You can find your secret key in your site settings page: https://publishers.viglink.com/publisher/sites Now you can test the API by making a request with your web browser. When you are done testing be sure to disable the mod header extension as it can interfere with browsing websites.

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 }}