There is no license information available for the latest version (1.0.0) of this package.

A PHP package to interface with the FMTC Api

1.0.0 2016-03-25 19:39 UTC


This is the official php package to interface with FMTC's API.


  • Migrate the database schema
  • Fetch FMTC's feeds (json): deals, categories, types, merchants and networks
  • Process full and incremental feeds and store in database
  • Retreive records from the database with an easy to use API


composer require fmtc/fmtc-php


  • PHP >5.4
  • You may need to increase timeout so the larger API calls don't fail.
ini_set('default_socket_timeout', 6000);


$fmtc = new Fmtc\Fmtc([
	'api_key' => 'api_key',
	'database' => 'database',
	'host' => 'host',
	'username' => 'username',
	'password' => 'password'

Fetch JSON Feeds

// Note: these methods return raw json

// Deal Feed

// Merchant Feed

// Category Feed

// Type Feed

// Network Feed

Migrating the Database

// migrate the database

// rollback the migration

Processing Feeds

// Note: these methods pull down the JSON, parse it, normalize it, and store it in the database.

// Deal Feed

// Merchant Feed

// Category Feed

// Type Feed

// Network Feed

Retrieving Records These are methods to retreive records from the database. The methods return single objects or arrays of objects. The results are sorted by rating by default.

// Deals
$fmtc->deals()->all([$limit, $offset]);
$fmtc->deals()->getByCategorySlug($categorySlug, [$limit, $offset]);
$fmtc->deals()->getByTypeSlug($typeSlug, [$limit, $offset]);
$fmtc->deals()->getByMerchant($merchantId, [$limit, $offset]);
$fmtc->deals()->getByMasterMerchant($masterMerchantId, [$limit, $offset]);
$fmtc->deals()->getBySearch($searchString, [$limit, $offset]);

// Merchants

// Categories

// Types

// Networks

// Custom Fmtc Url
$fmtc->api()->fetchUrl($url, [$options]);