DEV Community

Alex Spinov
Alex Spinov

Posted on

Polar Has a Free API: The Open-Source Billing Platform That Lets You Monetize Your Developer Project in 10 Minutes

You built an open-source tool that thousands of developers use. Your GitHub repo has 2,000 stars. But your "Buy Me a Coffee" button generated $12 last year. The problem isn't that people don't want to support you — it's that existing monetization tools weren't built for developers. Polar was.

What Polar Actually Does

Polar is an open-source billing and monetization platform built for developers and OSS maintainers. Think Stripe plus GitHub Sponsors, with a developer-first API. It handles subscriptions, one-time donations, issue funding, and digital product sales.

Polar is open-source (Apache 2.0), self-hostable, but their hosted platform at polar.sh charges zero monthly fee — just a small transaction percentage. The REST API uses OAuth2 or API keys.

The critical difference from Patreon: Polar integrates with GitHub. Fund specific issues, reward contributors, automate benefits like private repo access for paying subscribers.

Quick Start

Get your API token from polar.sh Settings > Developers > New Token.

export POLAR_TOKEN="your_token_here"

# List your products
curl -s https://api.polar.sh/v1/products \
  -H "Authorization: Bearer $POLAR_TOKEN" | jq '.items[] | {id, name, price_amount}'
Enter fullscreen mode Exit fullscreen mode

Create a subscription tier:

curl -X POST https://api.polar.sh/v1/products \
  -H "Authorization: Bearer $POLAR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Pro Supporter",
    "description": "Priority issue responses + private Discord",
    "prices": [{
      "type": "recurring",
      "amount_type": "fixed",
      "price_amount": 900,
      "price_currency": "usd",
      "recurring_interval": "month"
    }]
  }'
Enter fullscreen mode Exit fullscreen mode

Check active subscribers:

curl -s "https://api.polar.sh/v1/subscriptions?active=true" \
  -H "Authorization: Bearer $POLAR_TOKEN" | jq '.items | length'
Enter fullscreen mode Exit fullscreen mode

3 Practical Use Cases

1. GitHub Issue Funding

Let users pledge money for specific bugs or features:

curl -s "https://api.polar.sh/v1/issues?is_badged=true" \
  -H "Authorization: Bearer $POLAR_TOKEN" | jq '.items[] | {
    title, funding_goal: .funding.funding_goal.amount,
    pledged: .funding.pledges_sum.amount
  }'
Enter fullscreen mode Exit fullscreen mode

Embed a funding badge in your README:

[![Fund with Polar](https://polar.sh/embed/fund-label.svg)](https://polar.sh/your-org)
Enter fullscreen mode Exit fullscreen mode

When you close a funded issue, Polar splits the reward between contributors.

2. Automate Benefits with Webhooks

Grant GitHub private repo access when someone subscribes:

app.post('/polar/webhook', async (req, res) => {
  const event = JSON.parse(req.body);
  if (event.type === 'subscription.created') {
    const github = await lookupGitHubUser(event.data.customer.email);
    await addCollaborator('your-org/private-repo', github, 'pull');
  }
  res.sendStatus(200);
});
Enter fullscreen mode Exit fullscreen mode

3. Checkout Links for Digital Products

curl -X POST https://api.polar.sh/v1/checkouts/custom \
  -H "Authorization: Bearer $POLAR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "YOUR_PRODUCT_ID",
    "success_url": "https://yoursite.com/thank-you",
    "customer_email": "user@example.com"
  }' | jq '{checkout_url: .url}'
Enter fullscreen mode Exit fullscreen mode

Embed it in your README — every click goes to checkout with email pre-filled.

Why This Matters

Open-source sustainability is broken. Polar is the first platform that understands the developer workflow: GitHub-centric, API-first, developer-controlled. The issue funding model changes the dynamic — instead of hoping people donate, users can fund the features they want.

Zero monthly fee, clean API, and GitHub integration. If you maintain any OSS project with users, set up Polar before burnout hits.


Need custom data extraction or web scraping solutions? I build production-grade scrapers and data pipelines. Check out my Apify actors or email me at spinov001@gmail.com for custom projects.

Follow me for more free API discoveries every week!

Top comments (0)