Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.49 KB

File metadata and controls

42 lines (29 loc) · 1.49 KB

Usage

Core URLs

Purpose URL
Swagger UI http://localhost:8000/docs
Health GET /health
Webhook verify + events GET / POST /webhook
Webhook event log (DB) GET /webhook/events
Instagram API proxy /instagram/...
Local comment store /comments/...

Expose webhooks (HTTPS)

Meta requires a public HTTPS URL. Examples:

# Cloudflare quick tunnel
cloudflared tunnel --url http://localhost:8000

# ngrok
ngrok http 8000

In Meta for Developers → your app → WebhooksInstagram:

  • Callback URL: https://<tunnel-host>/webhook
  • Verify token: must match META_WEBHOOK_VERIFY_TOKEN in .env

Subscribe to fields such as mentions and comments for your connected Instagram professional account.

Instagram Graph behaviour (summary)

  • Owned mediaGET /instagram/media/{id}, comments, insights require the media to belong to INSTAGRAM_USER_ID.
  • Hashtag resultsGET /instagram/hashtag/{tag}/recent and /top use a reduced fields set (see code / Meta limits).
  • Business DiscoveryGET /instagram/user/by-username/{username} uses business_discovery.username(handle){...}.
  • Mention listing — Graph does not support GET /{ig-user}/mentions; use webhooks + GET /instagram/user/{id}/mentioned_media/{media_id}.

Local database

SQLite file meta_webhooks.db (default) stores webhook events and tracked comments. Do not commit it (see .gitignore).