What credit card transactions geolocated data can tell us

3 min reading
What credit card transactions geolocated data can tell us


Thanks to the commitment of BBVA Bancomer with the continuous exchange between them and the developer communities, now we have a great opportunity to perform geospatial analysis over thousands of credit card transactions in Mexico. Since October 20th, it’s possible to consume via REST API a set of statistics by geographical area (average payment, volume of transactions, number of cards…) based on the aggregation of transactions made by BBVA Bancomer cards in 3 cities of Mexico (Mexico DF, Guadalajara and Monterrey) between November 2013 and April 2014. This initiative takes place in the frame of the InnovaChallengeMX competition.

So, we have a really big dataset, just ready to be used for geospatial analysis. That means the data is ready to answer questions. Not obvious questions. That’s what geospatial analysis is for! Which questions could be answered?

Because of the properties of the dataset, first questions that could come to our minds are related with the age range/gender/category distribution of payments?

    – What are the most populars places for young people to spend their money?

    – In which categories do women prefer to spend money?

   – Where is the party zone of each city? (where the people spend more money in bars, pubs, restaurants, etc)

   – How large are the influence areas of each food store? (tip: use Voronoi Diagrams)

Those questions can be easily answered using this dataset to build a map showing clusters of points or category-based visualizations. Something that you can easily achieve using CartoDB. Have a look at CartoDB Editor documentation, to learn how CartoDB can help you creating visualizations like these in a matter of minutes.

Oh, yes, of course. You still need the data stored in a table. Don’t worry, we have you covered: learn how to extract data from BBVA API and store it into a CartoDB table.

But let’s continue trying to figure out what kind of questions could be answered with such a dataset. We could enrich it with additional data sources. For example…

What about getting data from Foursquare, to relate payments with venues? This would answer questions like:

    – Which are the most popular clothing stores in the areas where the spending on those categories are the highest?

    – How a typical weekend would look like, in terms of expenses (first, go to a restaurant, then to the movies, then have some drinks…)

And what about ATM locations? VISA provides a global ATM locator service accessible via API. So, we could answer a question like: are there enough ATM near restaurants?

The Government of Mexico also provides some public data that could be useful. For example, the population: what’s the relation between the population of a locality and the spendings of each category into that locality?

But back to the original dataset, one interesting finding was that it contains the zipcode of customer home locations for each payment. So, you can know:

    – top 3 locations by expenses, with the routes followed to get to that point

    – average distance to make a payment on each category / age range

Last, but not least, we may notice that the payments contain a date, and even peak and valley hours for payments. This date property brings the idea of using Torque, the cool CartoDB feature that allows us to create animated maps that change over time and space. Here, and example of the impact of the Mobile World Congress 2012, in Barcelona. It was done analyzing credit card transactions during the conference. Using Torque, you can answer questions like:

    – What’s the impact of Christmas week in terms of expenses in specific categories and/or areas of the city?

    – How is the evolution of a typical day of expenses for people of a given age range? You may want to use this API call

With these examples, we have only scratched the surface of the kind of things we can do using basic geospatial analysis operations over credit cards transaction data. But for sure, you will find more ways to explore and visualize what’s going on with this dataset, and extract your own conclusions. So, what are you waiting for? Go hack and explore!

It may interest you