Thanks to visit codestin.com
Credit goes to github.com

Skip to content

world1dan/customers-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polar Customers Map 🗺️🌍

Cover

Visualize your customers around the world! Fetches orders directly from your Polar organization and highlights every country where you've ever had paying customers.

Features

  • Ranks countries by revenue
  • Exports to PNG, JPEG, or WebP
  • Excludes trials and $0 orders
  • 🔒 100% private — your auth token is never stored

Currently supports Polar. Additional platforms coming soon.


API

Generate map images programmatically. Perfect for embedding in dashboards, reports, or automations.

Endpoint

GET /api/v1/map
GET https://customers-map.vercel.app/api/v1/map

Parameters

Required:

  • polar_access_token — Your Polar API access token
  • organization_id — Your Polar organization ID

Optional:

  • formatpng | jpeg | webp (default: png)
  • scale1 | 2 | 3 (default: 2) — Higher values = sharper images
  • displayCountryRevenuetrue | false (default: false)
  • colorSchemelight | dark (default: light)

Quick Start

curl -X GET 'https://customers-map.vercel.app/api/v1/map?polar_access_token=YOUR_TOKEN&organization_id=YOUR_ORG_ID' \
  -o map.png

Examples

High-resolution dark mode with revenue labels:

curl -X GET \
  'https://customers-map.vercel.app/api/v1/map?polar_access_token=YOUR_TOKEN&organization_id=YOUR_ORG_ID&format=webp&scale=3&colorScheme=dark&displayCountryRevenue=true' \
  -o customers-map.webp

Use in JavaScript:

const mapUrl = new URL('https://customers-map.vercel.app/api/v1/map');
mapUrl.searchParams.set('polar_access_token', token);
mapUrl.searchParams.set('organization_id', orgId);
mapUrl.searchParams.set('format', 'webp');
mapUrl.searchParams.set('scale', '3');

const response = await fetch(mapUrl);
const imageBlob = await response.blob();

About

Visualize your customers around the world!

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors