fbpx
Back

FMTC Tech Corner: Get Deals and Get Merchants

Twitter Facebook Linked In Paper Plan

As the internet continues to transform the world, there is a humble but powerful technology at the heart of it all: the API.

 

APIs, or Application Programming Interfaces, are systems that allow computers to talk to each other.  And in a broader sense, APIs allow companies to communicate, enabling business transactions and the transfer of various kinds of data.

At FMTC, we use APIs to retrieve data from our partners, and we also provide data to our clients through an API.  When you subscribe to FMTC, you receive an API token that lets you access our API endpoints.

We provide two main API endpoints: getMerchants and getDeals. These endpoints are where you will retrieve the bulk of your FMTC data. We also provide endpoints for merchant logos, deal types, deal categories, deal changes, and networks. None of these endpoints are paginated; they each return their complete result set in a single API call.

 

Here is an overview of the FMTC API endpoints:

getMerchants: returns your list of selected merchants, as chosen by you in your FMTC account. Clients typically call this endpoint from a cron (scheduled) job a few times per day.

getDeals: returns all the current deals from your selected merchants, making it your most important FMTC API call. The response can be quite large (many MB) if you have many merchants selected, so be sure to specify a large timeout of 7200 seconds in the client that you use to call this endpoint, such as wget or curl. You should call getDeals every few hours via cron.  You may also want to create a second cron job to call this endpoint every 30 minutes with the additional parameter &incremental=1 — this will return only the deals added or changed since your last incremental call, so its result will be much smaller than from the full getDeals call. Don’t miss our flowcharts to see how your system should process the deals.

getLogos: returns a zip file containing the logos for all your selected merchants. If you show a merchant directory on your site, you may wish to use these logos on that page. You would typically not need to visit this endpoint very often, unless you frequently add/remove merchants.

getTypes and getCategories: return a list of the deal types and deal categories in the FMTC system, including their URL slugs such as the “flashdeal” and “freeshipping” types, or the “apparel-men” and “gifts-flowers” categories.  If you want a list of deals from only specific types or categories, you can specify those via URL parameters on your getDeals call, for example: &dealtype=flashdeal,freeshipping or &categoryids=apparel-men,gifts-flowers.

getChanges: when calling this endpoint, you specify a particular couponid, and the API returns a list of any changes that have occurred for the specified deal, such as an updated label, a changed expiration date, etc. You don’t normally need to call this endpoint, because getDeals will always return the most recent values for all the fields on each deal.

getNetworks: returns a list of all the affiliate networks that FMTC currently works with.

 

getDeals is Essential

Now you have a high-level view of the information available in the FMTC API. For most clients, getDeals is the essential endpoint, and getMerchants is also frequently used. The rest of the endpoints are optional, based on your own site design and business needs.

When you’re ready for more details, you can dive into our full API documentation.

-FMTC Tech Team