This Cloudflare Worker connects to Instagram accounts and serves Instagram media via API endpoints.
Direct Instagram OAuth authentication for accessing your Instagram account.
Requirements: Instagram Business or Creator account
Get user's Instagram media (cached for 1 hour)
You can use either the user ID or Instagram username (with or without @).
Parameters:
limit (optional) - Number of media items to return (default: 25)after (optional) - Pagination cursorbust (optional) - Set to "true" to bypass cacheCaching: Responses are cached for 1 hour. Check the X-Cache header (HIT/MISS).
GET /images/123456789?limit=10&after=cursor_value # By user ID GET /images/johndoe?limit=10 # By username GET /images/@johndoe # With @ symbol GET /images/123456789?bust=true # Force fresh data
Get specific media item details
You can use either the user ID or Instagram username.
GET /image/123456789/media_id_here # By user ID GET /image/johndoe/media_id_here # By username
Clear cached media for a user
Call this endpoint when new media is posted to Instagram to refresh the cache.
POST /cache/bust/123456789
Instagram webhook endpoint (automatic cache busting)
GET: Webhook verification endpoint
POST: Receives webhook events from Instagram
Configure this in your Instagram app settings to automatically bust cache when new media is posted.
Verify Token: instagram_webhook_verify_2025
Health check endpoint
GET /health
https://instagram.larka.tech/webhookinstagram_webhook_verify_2025media events