This project was vibe coded using Claude with input and oversight from clayton
Automatically adjust App Store in-app purchase and subscription prices across territories using purchasing power parity (PPP) pricing, with USD as the anchor currency. Uses the Big Mac Index to determine fair pricing based on local purchasing power.
This Ruby CLI tool helps you maintain fair pricing across different countries by adjusting prices based on purchasing power parity. Instead of using simple exchange rates, this tool considers the relative cost of living in different countries to set more equitable prices.
The tool uses the Big Mac Index from The Economist as its PPP data source, covering ~50 countries with the most active app markets.
- Uses your USD pricing as the anchor
- Fetches PPP data from the Big Mac Index
- Calculates PPP ratios for each country (local_big_mac_price / us_big_mac_price)
- Adjusts your product prices proportionally:
local_price = usd_price Γ ppp_ratio - Matches calculated prices to Apple's available price tiers for each territory
- Previews changes or applies them to your App Store products
- Ruby 2.7 or higher
- App Store Connect API credentials
- Bundler (
gem install bundler)
- Clone or download this project:
cd AppStorePriceLocalizer- Install dependencies:
bundle install- Configure your credentials:
cp .env.example .env- Edit
.envand add your App Store Connect API credentials:APP_STORE_KEY_ID- Your API Key IDAPP_STORE_ISSUER_ID- Your Issuer IDAPP_STORE_PRIVATE_KEY- Your .p8 private key content (including BEGIN/END lines)
- Go to App Store Connect
- Navigate to Users and Access > Keys
- Generate a new key with "Admin" or "App Manager" role
- Download the .p8 file and note the Key ID and Issuer ID
- Copy the contents of the .p8 file to your
.envfile
Preview price changes (dry run - default):
./price_localizer.rb YOUR_APP_IDApply price changes:
./price_localizer.rb YOUR_APP_ID --applyProcess specific products only:
./price_localizer.rb YOUR_APP_ID --products product_id_1,product_id_2Enable debug output:
./price_localizer.rb YOUR_APP_ID --debugForce refresh of PPP data:
./price_localizer.rb YOUR_APP_ID --forceAPP_ID- (Required) Your App Store app ID (positional argument or--app-idflag)--products ID1,ID2- (Optional) Comma-separated list of specific product IDs to process--apply- Actually make the price changes (default is dry-run preview)--force- Force recalculation even if data is cached--debug- Enable verbose debug output-h, --help- Show help message
1. Preview all price changes for an app:
./price_localizer.rb 67473967992. Apply changes to specific subscription:
./price_localizer.rb 6747396799 --products com.myapp.premium --apply3. Update all prices with fresh data:
./price_localizer.rb 6747396799 --force --applyπ App Store Price Localizer
App ID: 6747396799
Mode: π DRY RUN (preview only)
================================================================================
π± Fetching app information...
App: My Awesome App
Bundle ID: com.example.myapp
π¦ Fetching in-app purchases and subscriptions...
Found:
- 2 subscription(s)
- 3 in-app purchase(s)
π Territory Coverage:
π Big Mac Index data: ~48 countries
================================================================================
π± Subscription: Premium Monthly (com.myapp.premium.monthly)
Fetching current prices...
Fetching available price points...
US Price (anchor): $9.99
π Price Comparison:
-------------------------------------------------------------------------------------------------------------------
Territory Country Current Proposed Change PPP Source
-------------------------------------------------------------------------------------------------------------------
USA United States $9.99 $9.99 anchor 1.00x anchor
AUS Australia 14.99 8.49 -43.4% 0.85x Big Mac
BRA Brazil N/A 6.99 new 0.70x Big Mac
CAN Canada 13.99 9.49 -32.2% 0.95x Big Mac
GBR Britain 9.99 9.99 0.0% 1.00x Big Mac
JPN Japan 1200 1150 -4.2% 1.15x Big Mac
...
-------------------------------------------------------------------------------------------------------------------
π Dry run complete. No changes were made.
Run with --apply flag to make these changes.
The tool uses the Big Mac Index from The Economist to determine fair pricing across territories:
- Big Mac Index: Compares the price of a Big Mac in different countries
- PPP Ratio:
local_big_mac_price / us_big_mac_price - Localized Price:
usd_price Γ ppp_ratio - Coverage: ~48 countries (major app markets)
- Update Frequency: Bi-annual, cached for 7 days
- US Big Mac: $5.79
- UK Big Mac: $5.72
- PPP Ratio: 5.72 / 5.79 = 0.99
- If US subscription is $9.99, UK price would be: $9.99 Γ 0.99 = $9.89
This approach provides pricing that reflects local purchasing power rather than just currency exchange rates.
Apple uses predefined price tiers for each territory. The tool automatically finds the closest available price tier to your calculated price.
The Big Mac Index covers ~48 territories including major app markets:
- Americas: US, Canada, Brazil, Mexico, Argentina, Chile, Colombia, Costa Rica, etc.
- Europe: UK, Switzerland, Sweden, Norway, Poland, Czech Republic, Hungary, Romania, etc.
- Asia-Pacific: Japan, Australia, China, Hong Kong, Singapore, Thailand, South Korea, Taiwan, etc.
- Middle East: UAE, Saudi Arabia, Israel, Kuwait, Jordan, Qatar, Egypt, Lebanon, etc.
- Africa: South Africa
Countries not in the Big Mac Index will not have prices automatically set.
- Big Mac Index: The Economist's GitHub Repository - PPP indicator based on Big Mac prices
- App Store Pricing: Apple App Store Connect API
Data caching:
- Big Mac Index data is cached locally for 7 days
- Use
--forceto refresh cached data
AppStorePriceLocalizer/
βββ price_localizer.rb # Main CLI script
βββ lib/
β βββ app_store_connect.rb # Apple API client
β βββ big_mac_index.rb # Big Mac Index PPP data handler
β βββ world_bank_ppp.rb # World Bank data (currently disabled)
β βββ territory_mapper.rb # ISO3 β Apple territory mapping
β βββ price_calculator.rb # Price calculation logic
βββ Gemfile # Ruby dependencies
βββ .env.example # Environment variables template
βββ .gitignore
βββ README.md
The tool runs in dry-run mode by default and will only preview changes. You must explicitly use --apply to make actual price changes.
The tool skips applying prices that change by less than 1% to avoid unnecessary API calls.
Be aware of Apple's API rate limits. The tool processes products sequentially to avoid hitting rate limits.
- Existing subscribers may be grandfathered at old prices depending on your settings
- Price changes may require user consent in some regions
- Consider testing with a single product first
- Informal but widely-recognized PPP indicator
- Covers ~48 major app markets
- Updated bi-annually by The Economist
- Good for relative price comparisons across countries
- Based on consumer prices (Big Mac = standardized consumer good)
- PPP may not reflect all local economic factors
- Limited to countries where McDonald's operates
- Some territories use the same currency (e.g., Eurozone) but have different purchasing power
- Data updates have inherent delays (bi-annual)
Make sure you've created a .env file from .env.example and filled in your credentials.
Ensure your product has a price set for the US territory in App Store Connect.
Verify your app ID is correct and that the app has in-app purchases or subscriptions configured.
- Check that your API key is still valid
- Ensure your API key has sufficient permissions (Admin or App Manager)
- Verify the key hasn't expired
This tool was inspired by the AppStoreTranslator project and follows similar patterns for Apple API integration.
- AppStoreTranslator - Automatically translate App Store metadata
- AppStoreReviewIntelligence - Analyze and gain insights from App Store reviews
See LICENSE file for details.
This tool makes changes to your App Store pricing. Always preview changes carefully before applying. The authors are not responsible for any pricing errors or issues that may result from using this tool.