DEV Community

Andrew Seeley
Andrew Seeley

Posted on

Building a Pay-Per-Request Instagram Data API (Next.js + Convex + Clerk)

Most Instagram data APIs I looked at fell into two buckets: RapidAPI-style scrapers with unpredictable uptime, or "contact sales" enterprise products with approval queues. I wanted something self-serve — sign up, get a key, pay for what you use.

What it does

Instagram API is a REST API for public Instagram data:

  • Profiles, posts, reels, stories
  • Hashtag and location search
  • Bearer token auth, JSON responses
  • Pay-per-request pricing, no subscription

Stack

  • Next.js for the app + API gateway
  • Convex for the database and usage/credit tracking
  • Clerk for auth
  • Stripe for prepaid credit packs

The gateway sits in front of the underlying data provider, normalizes responses, and meters usage per request so pricing can stay pay-as-you-go instead of tiered subscriptions.

Docs

Full OpenAPI 3.1 spec is public at instagramapi.dev/openapi.json, and there's a Postman collection if you'd rather explore it that way.

Happy to answer questions about the architecture or the pricing model — feedback on what endpoints would actually be useful is especially welcome.

Top comments (0)