The McFlurry Index: Mapping McFlurry Machine Status Across the U.S.

Oct 18, 2024

Demo

Introduction
At CoffeeBlack AI, we're all about transforming alternative data into actionable insights. Our latest project, the McFlurry Index, leverages McDonald's store data, AI-driven phone calls, and cutting-edge data visualization techniques to map the real-time status of McFlurry machines across the U.S. Using technologies like OpenStreetMap, the U.S. Census Bureau’s Zip Code index, and D3.js, we built a dynamic heatmap to show where you can grab a working McFlurry machine.

Data Collection: McDonald's API Meets the U.S. Census Bureau
We began by pulling McDonald's store data using their "Find a Store" API. This gave us key details like store addresses, geographic coordinates, and additional contact information. To ensure comprehensive national coverage, we enriched this data with the U.S. Census Bureau's Zip Code index, conducting a 30-mile radius search around each zip code.

To handle the large volume of store data (across thousands of zip codes), we applied deduplication techniques to remove redundant store entries that may have shown up in multiple search radii. The entire process was automated using a Python-based script, ensuring the dataset was clean and free of duplicates.

Calling the Stores: Bland AI in Action
Static data alone wasn’t enough to track real-time machine statuses, so we turned to Bland AI for dynamic, automated data collection. We created a custom "AI Pathway" to call each store and ask a simple but critical question: “Is your McFlurry machine working?” Bland AI handled these calls with a conversational AI model, recording whether the machine was operational or if the store went to voicemail or didn't answer at all.

On the backend, the responses were parsed using LLMs, automatically categorizing stores based on machine status. Voicemail detections and unanswered calls were flagged for potential follow-up, ensuring accuracy in the final dataset.

Visualization: Dynamic Hexbin Maps and Heatmaps
With the enriched McFlurry machine data ready, we focused on visualization. For this, we opted for a hexbin map—a visualization method that uses hexagonal tiles to represent geographic areas. We used D3.js to dynamically generate hexagonal tiles that fit within the bounds of the U.S. map. By using geographic bounds from OpenStreetMap, we ensured our tiles matched real-world locations.

To make the map more engaging and informative, we overlaid a heatmap across these hexagonal tiles, with color gradients representing McFlurry machine status. Green indicated stores where the McFlurry machine was working, while red represented stores where it was out of order or unavailable. In areas with multiple stores, the map aggregated the data, reflecting the density and status of McFlurry machines within that region.

Conclusion
The McFlurry Index is more than just a fun side project—it’s a testament to the power of combining AI-driven real-time data collection with advanced visualization techniques. Our approach, blending static data from APIs with real-time updates from automated calls, allowed us to create a dynamic and highly informative map. The heatmap not only serves McFlurry lovers but also demonstrates how AI can automate data collection at scale, turning it into actionable insights.

Interested in how CoffeeBlack AI can help you harness alternative data streams for your business? We’d love to chat.

Calendly or Twitter