In-depth look at the JSON output and object description table of coupon API made by Linkmydeals
In this article, I will provide a clear explanation of the object table and JSON output of Linkmydeals coupon API. As a programmer, you may already be familiar with these concepts, but understanding how they are utilized in the context of Linkmydeals' coupon API can be valuable in effectively working with the data. By breaking down the structure and components of the object table and JSON output, I aim to provide a comprehensive understanding of how the API provides coupon data to its users.
Object and description table
Objects | Description |
lmd_id | Unique ID of the offer maintained by LinkMyDeals |
Status | In case of Incremental Feed, this will be new/updated/suspended |
Title | Offer title |
Description | Offer description stating all important Terms & Conditions |
Type | Coupon Code or Deal |
Coupon Code | Code to be applied to avail the offer. Empty in case of a deal |
Offer | Type of offer, i.e. Percentage Off, Price Off, Cashback, BOGO, Sign-Up, etc |
Offer Value | The exact percentage or price that is discounted on using the offer |
Store | Name of the Online store |
Categories | Comma separated list of all categories |
URL | URL of the Landing page |
Image | Image URL |
Affiliate Link | Deeplink by your preferred Affiliate Network |
Publisher Exclusive | Unique Coupon Code/Deal especially for you (Only for Exclusive plan members) |
Start Date | Date from which offer is applicable |
End Date | Date when the offer expires |
lmd_id: This is a unique ID assigned by LinkMyDeals to the offer. It can be used to uniquely identify the offer.
Status: This field indicates the status of the offer in case of an incremental feed. The possible values are new, updated, or suspended.
Title: The offer title is a brief description of the offer. It gives the user an idea of what the offer is about.
Description: This field contains a detailed description of the offer. It provides all the important terms and conditions that are applicable to the offer.
Type: This field indicates whether the offer is a coupon code or a deal. If it is a coupon code, then the user needs to apply the code to avail the offer. If it is a deal, then the discount is automatically applied when the user clicks on the deal.
Coupon Code: This field contains the coupon code that the user needs to apply to avail the offer. This field is empty if the offer is a deal.
Offer: This field contains the type of offer, such as percentage off, price off, cashback, buy-one-get-one (BOGO), sign-up bonus, etc.
Offer Value: This field contains the exact percentage or price that is discounted when the offer is used. For example, if the offer is "10% off," then the offer value is 10%.
Store: This field contains the name of the online store where the offer is available.
Categories: This field contains a comma-separated list of all the categories that the offer belongs to.
URL: This field contains the landing page URL where the user can find the offer.
Image: This field contains the URL of the image associated with the offer.
Affiliate Link: This field contains the deeplink generated by the user's preferred affiliate network.
Publisher Exclusive: This field indicates if the offer is a unique coupon code or deal that is available exclusively for certain plan members.
Start Date: This field contains the date from which the offer is applicable.
End Date: This field contains the date when the offer expires.
The information in the table provides valuable data about offers available on various online stores, which can be used by developers to build applications or services that help users find and avail these offers. The table contains important information such as the offer type, discount value, store name, and offer expiration date, which are crucial for users to make informed decisions. The lmd_id field serves as a unique identifier for each offer, making it easy to retrieve specific offers from the database. Additionally, the deeplink provided in the Affiliate Link field enables developers to track user clicks and generate revenue through affiliate marketing. Overall, the information in the table can be leveraged to create applications and services that help users save money while shopping online.
Explaining the JSON Request
The given code is a PHP script that calls the LinkMyDeals coupon API and retrieves offers data in JSON format. It uses several configuration parameters such as API_KEY, incremental, last_extract_datetime, format, and off_record to customize the API request. The API response is processed using the json_decode() function, which converts the JSON string to a PHP associative array. The script then iterates over each offer in the $offers array and checks its status using a conditional statement. If the offer status is "new", the script inserts the offer in the database. If the offer status is "updated", the script updates all fields in the offer. If the offer status is "suspended", the script deletes the offer from the database. This code can be used by developers to automate the process of retrieving and managing offers data from the LinkMyDeals coupon API in their applications or services.
// ========== CONFIG ==========
$API_KEY = '[YOUR_API_KEY]'; // Enter your API Key or use API Key from Demo account for testing/development
$incremental = true;
$last_extract_datetime = '2010-01-01 00:0:00'; // Ideally leave this blank. Populate only if you want to override last extract time stored in the system
$format = 'json';
$off_record= false; // If set to true, system will not update your last extract time. This is useful for debugging pupose. Please note, this will still count in your API Usage limit
// ========== CALL API ==========
$last_extract = (empty($last_extract_datetime) ? '' : strtotime($last_extract_datetime) );
$feed = file_get_contents('http://feed.linkmydeals.com/getOffers/?API_KEY='.$API_KEY.'&incremental='.$incremental.'&last_extract='.$last_extract.'&format='.$format.'&off_record='.$off_record);
// ========== PROCESS JSON RESPONSE ==========
$response = json_decode($feed,true);
$offers = $response['offers'];
foreach($offers as $offer) {
if($offer['status'] == 'new') {
// Write Code here to insert the offer in your database
} elseif($offer['status'] == 'updated') {
// Write Code here to update all fields in the offer
} elseif($offer['status'] == 'suspended') {
// Write Code here to delete the offer in your database
}
}
?>
Conclusion
In this article, we discussed the object table and JSON output of Linkmydeals coupon API. The object table provided a detailed description of the various objects available in the API, including their descriptions and uses. We also looked at a sample JSON output code that shows how to call the API and process the response data. The JSON output code demonstrated how to use the API to fetch coupon offers and handle them based on their status. Understanding the object table and JSON output of the Linkmydeals coupon API is essential for developers who want to use the API to develop coupon-related applications.
Reference
If you are interested in accessing the Linkmydeals coupon API, you may request access through the third-party data marketplace of Worldindata. Once approved, you will be able to retrieve coupon data and integrate it into your own platform or application. The Linkmydeals API offers real-time updates and a variety of filtering options to ensure that you receive only the most relevant coupon data for your needs. To get started, simply visit the Worldindata marketplace and submit a request for API access.