Capital One Puts Machine Learning To Work In New Merchant Insights API

At this week’s API Strategy & Practice conference in Portland, OR, Capital One announced the latest addition to its DevExchange portfolio of public APIs; the Merchant Insights API. True to its name, the API offers some insights into merchants; insights that are based on the information collected through customer transactions when a Capital One credit card is used. More interestingly, the new API is yet another example of an enterprise putting machine learning to work in the context of an API.

For now, in this early release phase, the API offers a narrow scope of capability. In order to successfully query the API for insights into a particular merchant, the developer must provide both the name and address of the merchant (the rendering of the name doesn’t have to be exact). 

In response, the API returns the hours during which the business at that address is open along with the four most common ranges (called “bins”) for transaction dollar values. It identifies which of those ranges covers the median expenditure as well as the category of the business. An example response would look something like this JSON fragment below. 

{ 
   "merchantInsights": [           
       {   
         "merchantId": "1000995031",
         "matchScore": 1.00,
         "merchantName": "KRYSTAL ATLF11",
         "city": "DALLAS",
         "stateCode": "GA",              
         "postalCode": "30132",
         "categoryName": "Dining and Entertainment",
         "merchantPriceBin": 
             {
               "currencyCode": "USD",
               "categoryPriceBins": [ 
                  { 
                   "lowerLimit": 0,
                   "upperLimit": 9.99,  
                   "binNumber": 1  
                  },
                  { 
                    "lowerLimit": 10,
                    "upperLimit": 19.99,
                    "binNumber": 2 
                  },    
                  { 
                    "lowerLimit": 20, 
                    "upperLimit": 29.99,
                    "binNumber": 3
                  },
                  { 
                    "lowerLimit": 30,
                    "upperLimit": 999999.99,
                    "binNumber": 4
                  }                            
               ],
               "merchantMedianPriceBinNumber": 1 
             },                      
          "openHours": [
             {
               "dayOfWeek": "Monday”,
               "openTime": "11:00”,
               "closeTime": "22:00”
             },
             { "dayOfWeek": "Tuesday”,
               "openTime": "11:00”,
               "closeTime": "23:00”
             }

Although not shown in the sample output above, the API also rank orders each hour of the day based on the number of transactions during that hour. For example, the busiest hour of the day might receive a rank of 10 while other hours would receive lower numbers (the number don't represent the number of transactions; it's just a rank).  With this bit of data, developers can show the times during which an establishment is busiest. For example, in the screenshot from the sample app below, the user can see a bar chart that compares timeframes across the day in order to determine the best (least busiest) time for a visit. 
 


A sample app that relies on data from Capital One's Merchant Insights API (source: Capital One)

According to Capital One product manager Anjana Tayi, Capital One doesn’t actually know the hours during which a business is open. However, the data scientists at the financial institution designed a machine learning model that derives those hours from the timestamps on the transactions. Capital One used a third party machine learning solution to build the models that sift through new transaction data and update the database behind the API every two weeks. However, company officials declined to say which of the various third party ML offerings (ie: Google’s Tensor Flow for model construction) they’re using.

In addition to developers that may contemplate some sort of unique use case for the data, the sort of companies that might benefit from such an API would involve the retail search space. For example, Google typically provides the hours that an establishment is open once a user starts to zero in on that establishment through Google Search or Maps. But that data is more than likely discovered through error-prone means such as scraping and crowd-sourcing versus something like Capital One’s Merchant Insight’s API which is based on something that’s guaranteed to be a bit more truthful. 

Tayi identified FourSquare as another type of company that might benefit from the new API. However, Tayi was quick to point out that Google and FourSquare are just examples and that Capital One is in discussions with “a number of different organizations” but could not be more specific about which ones. 

The Terms of Service for the API limit developers to 30 days for the caching of any data that was retrieved through the API. Also, according to Tayi, using the API for competitive intelligence (for example, one business looking to undermine a competitor) is prohibiited.

One last important point: the data itself is anonymized in such a way that no cardholder personal information is revealed in the course of an API call. 

 

Comments (0)