Case Studies

How a 1-Day Initiative Helped Us Cut 1200$ Cost and Improve Performance

Discover how a one-day initiative at Optiblack led to a $1,200 cost reduction and improved app performance through innovative in-house country detection.


At Optiblack, some of the most impactful improvements don’t come from client requirements—they come from internal ownership and curiosity. This was one such initiative.

While working on multiple apps for a client, our team noticed we were relying on IPAPI for country detection. It was working fine—but came with recurring costs (~$20/month), added latency, and an external dependency we didn’t fully control.

So we asked: Can we build a better, leaner solution ourselves?

The Effort: 1 Day Research + 6 Hours Build

This wasn’t a client requirement—it was a proactive engineering decision.

  • Day 1: Researching alternatives (GPS, device locale, offline datasets)
  • Next 6 hours: Building and integrating a local detection system across both apps

What started as a quick experiment turned into a production-ready improvement.

The Real Impact: $40 vs $1,200

While $20/month may seem small, over time it adds up:

  • $20/month → $240/year
  • Over a 5-year horizon → $1,200 total cost

By replacing this dependency, we effectively turned a $1,200 recurring expense into a one-time $40 investment.

The Solution: Local-First Country Detection

We replaced the API with a layered detection approach:

1. GPS-Based Detection (Primary)
We use device location and reverse geocoding to determine the most accurate country ISO code when permissions are available.

2. Device Locale (Fallback)
If location access is denied, we fallback to the device’s regional settings:

String countryISO = PlatformDispatcher.instance.locale.countryCode?.toUpperCase() ?? 'US';

 

3. Default Fallback
If both fail, we default to “US”, ensuring the system always returns a valid country.

Local Data = Zero API Calls

To make this system fully independent, we bundled a static JSON file (country_codes.json) inside the app. It contains country metadata like name, ISO code, dial code, and flag:

{"name": "United States", "code": "US", "dial_code": "+1", "flag": "🇺🇸"}

 

This allows instant mapping from ISO code to full country details—no network calls, no latency, no failures.

 

undefined-Apr-28-2026-10-08-05-0632-AM

 

Platform Considerations

  • Android: Uses geolocation and geocoding with proper permission handling and smooth fallback flows
  • iOS: Relies more on device Language & Region settings when location access is restricted, ensuring privacy compliance

The Outcome

A small initiative led to meaningful impact:

  • Saved ~$20/month in API costs
  • Improved performance with zero API latency
  • Enabled offline functionality
  • Reduced dependency on third-party services

Why This Matters

This wasn’t about shipping a feature—it was about thinking beyond requirements. Identifying inefficiencies, taking initiative, and solving them quickly.

At Optiblack, we believe great engineering isn’t just about building new things—it’s about continuously optimizing what already exists.

Similar posts

Get notified on new marketing insights

Be the first to know about new B2B SaaS Marketing insights to build or refine your marketing function with the tools and knowledge of today’s industry.