Logo moneo blanco

When life gives you lemons...

Well, in this case limes really. Mexican cuisine is famous for its use of hot chilies, but if you’ve ever lived or traveled a bit here you know that there’s one thing just as ubiquitous as the bowls of salsa on the tables; another bowl with little slices of bright green lime. These are squeezed onto almost any food, from the more obvious taco to somewhat less obvious things such as papaya before being consumed. There’s not a single market stall where lime is not served along with the food. Mexicans love lime, it’s just part of life here.

Light lemon

Finding the truth

I got curious and wanted to know how much the price has actually changed. Although funny, the memes did not prove to be a reliable source of pricing information. Neither did several attempts to search for official figures from the government. There are figures, even some annual averages, explanations of wholesale vs consumer prices and articles from 2014 and 2016 indicating that this is not the first time prices have soared, but here at Moneo we like to look at the fine details.

So when in late 2021 I started seeing memes about lime prices I knew something was up.

Lemon meme

What is Moneo?

Moneo is a cashback app that rewards users for submitting photos of their receipts. The service provides a broad array of offers from multiple brands and retailers. We have thousands of happy users uploading thousands of tickets each week. So in exchange for their purchasing data we give them money, not points, not NFTs or other less-than-ideal tokens of value, but real cash, transferred into their bank account.

So can I use our database to figure out the price of lime in Mexico?

A quick search for limon% gave me several thousand hits so it looks promising. We need to make sure we’re not comparing apples with oranges (pun intended) here so we’ll focus on Walmart and make sure to look at a specific type of line, in this case LIMON AGRIO (“sour lime”) seems to have a good number of hits and as far as I know that’s the one most people prefer over the seedless and slightly less sour ones.

Here’s how it appears on a ticket:

Lemon receipt

AI powered Veryfi OCR impresses

We partner with Veryfi for OCR and I’m still quite amazed at the quality of the OCR technology today. One thing is to be able to read a flatbed scanned piece of printed paper, another is to scan crumpled up pieces of badly printed thermal paper from a cell phone picture. But using a well trained neural network from our partners in Veryfi the results are impressively good, although not perfect.

50 year old Russian math does the rest

After the bleeding edge OCR gets done we also use a bit of fancy math. A D can easily become an O if the paper’s crease is just right so we use is a 50 year old string metric for measuring the difference between two sequences called the Levenshtein distance. The programmers tell me it’s really quite simple and again make me feel humble as they show me the formula.

Time to massage the data

So I hit the database again, this time filtering for LIMON AGRIO (“sour lime”) and only asking for the results from Walmart. This gives me bits of JSON that look like this “[ { "description": "LIMON AGRIO", "sku": "43052", "price": 59 } ]” along with receipt details including the date of purchase.

Our backend lets me download these results as an Excel spreadsheet. After playing around with some text formulas I managed to get a list of 399 price points and the dates from Feb 2 2021 to Jan 31 2022, or exactly one year.

Results

First of all, there is a lime price crisis in Mexico. From an average of 34 pesos per kilo the price has risen to 84 pesos per kilo in December and January, and nothing similar happened a year ago.

I’m lucky to have access to some cool tech from Veryfi and IBM that lets me play with this data. I hope to find some new interesting patterns and look forward to sharing them with you.

Lemon graphic