Get structured product data with this simple API call
Written by Josh Hutter
Welcome back to FMTC’s Tech Corner, where we take a deep dive into our tools and technology. This article discusses in detail the getProducts API endpoint.
The endpoint getProducts returns structured product data for over 142,000,000 products, providing you with normalized affiliate product links for our Product Feed. A call to getProducts is available in two machine-readable formats: JSON and XML. These format options can be configured by providing the “format” parameter to any request.
A basic getProducts call looks like this:
The key parameter is a string we provide in your dashboard that authenticates your request. The key is required for any requests to the getProducts endpoint; if it is missing, you will get an error message. For the rest of this post, we will use <YOUR_KEY_HERE> to represent your key.
While the mode parameter is not required, it is an important parameter to understand what you are getting back from your API call. The following values are the potential values for mode:
- getProduct: Returns one (single) CMID (Cross Merchant Identifier) product from all (selected) merchants. The results you will get back from this endpoint may return a single record from a single merchant. If you have multiple merchants selected in your feed (typical use case), you may receive multiple records for the single product. Please note: while FMTC normalizes and standardizes data across merchants and networks, the actual product data available varies from merchant to merchant.
- getProducts: Returns multiple unique products based on request parameters and selected merchants on your FMTC account. Multiple product (getProduct) objects will be returned with different merchant information.
- getMerchantProducts: Returns multiple products from one requested merchant based on request parameters. The merchant parameter is required for this mode to return the products properly.
A call to getProducts can be filtered using up to six parameters. Some of these parameters override each other. Here’s a breakdown:
network: Gives a comma-separated list of networks. Please use the slugs from the getNetworks endpoint. The example below will return deals for all the merchants you’ve selected from ShareASale and CJ.
merchant: Gives a comma-separated list of FMTC merchant program IDs for deals. The next example will return products for merchants #12345 and #9876. Merchant IDs can be found on the Manage Merchants page on your dashboard (“FMTC ID” column) or via a getMerchants API call.
category: Returns products for a particular category. This can only be done with top-level categories, not the sub-categories within FMTC. For example: clothing-apparel, education, health-beauty. To call, give a comma-separated list of category IDs. Category IDs can be found via a getCategories API call.
brand: Returns only products from a particular brand/manufacturer. Example: Nike, Hasbro, or Abercrombie & Fitch. To call, give a comma-separated list of deal types. A list of the brands within FMTC can be found in the Manage Product Brands section of the FMTC Portal. This example returns all products from all merchants that have the brand of Nike, Adidas, and Skechers.
latest and latest-time: The latest parameter will allow you to determine if you want the products filtered by the last time they were updated by the merchants, which will be done with the latest-time parameter. The latest parameter will be either a 0 or 1, while the latest-time value defaults to a “-24”, meaning within the previous 24 hours. The below example will return all deals for merchants in the United States.
on-sale: Are you only interested in products that are on sale? Add the on-sale parameter, a value of either 0 or 1. By default, this will be 0, ensuring that all products will be returned.
In addition, the getProducts endpoint is paginated. FMTC provides cursor pagination, and through the “cursor” parameter, it will provide both the nextCursor and backCursor values to traverse through the page results you receive through your current API call.
Downloading the getProducts feed will result in the fields listed in our API documentation. We encourage our subscribers to monitor the LastUpdate and ProcessedTime fields to ensure your products are up to date and working for your users.
There are five types of links provided by getProducts. Depending on your access, you might not see all these links:
- AffiliateURL: This is an affiliate link containing your own affiliate ID that goes to the merchant’s product landing page and sets the appropriate network cookie. To generate these links, you need to input your affiliate ID in our dashboard under Relationships > Manage Network IDs.
- FreshreachURL: A link using FMTC’s FreshReach® program. It will appear if both the merchant and your account are FreshReach® enabled. If you would like FreshReach® enabled, please reach out to your Account Manager.
- SubaffiliateURL: Link that lands on the page associated with the product and is monetized by a sub-affiliate network.
- FMTCURL: This URL goes through FMTC. FMTC will then determine the best link and send the users in that direction. FMTC will prioritize the links in the following order depending on your relationship status with the merchant: the AffiliateURL, the SubaffiliateURL, and then the DirectURL. As a note, for this to work correctly, you must enable MerchantSync. You can read about this in our previous Tech Corner article for more information.
- DirectURL: This is the direct, unmonetized non-affiliate link that lands on the page associated with the product. It may be a homepage link or a deep link.
For more information, please visit our full API documentation.
As always, our team is ready to help you! If you have any questions or concerns, feel free to contact your account manager or email us at [email protected] Curious about other FMTC technologies? Find more information on FMTC’s tools in Tech Corner:
- FMTC Tech Corner: getDeals Deep Dive
- FMTC Tech Corner: getMerchants Deep Dive
- FMTC Tech Corner: Get Deals and Get Merchants
- FMTC Tech Corner: Deal Types and the getTypes API
- FMTC Tech Corner: getNetworks
- FMTC Tech Corner: getLogos
- FMTC Tech Corner: The Product Feed
- FMTC Tech Corner: Pushed Deals
- FMTC Tech Corner: Program Directory
- FMTC Tech Corner: Full vs Incremental
- FMTC Tech Corner: Technical Achievements
- FMTC Tech Corner: Targeting Content
- FMTC Tech Corner: Restricted Deals
- FMTC Tech Corner: SubIDs
- FMTC Tech Corner: FMTCURL