API

Code Examples

Start with cURL, JavaScript, Python, PHP, Postman, BI tools, and scheduled jobs.

Start API integrations with copyable cURL, JavaScript, Python, PHP, Postman, BI, and scheduled-job patterns.

Never place a real API key in documentation, browser code, screenshots, or client-side configuration.

Use YOUR_KOMMON_POLL_API_KEY only as a placeholder.


Starter Examples

Set the key as an environment variable:

export KOMMON_POLL_API_KEY="YOUR_KOMMON_POLL_API_KEY"

List saved searches:

curl https://api.kommonpoll.com/v4/list \
  -H "Authorization: Bearer $KOMMON_POLL_API_KEY"

Request a 7-day overview:

curl "https://api.kommonpoll.com/v4/search?aid=<AID>&duration=7d&timezone=Asia%2FColombo" \
  -H "Authorization: Bearer $KOMMON_POLL_API_KEY"

Request the first page of newest mentions:

curl "https://api.kommonpoll.com/v4/search?aid=<AID>&duration=30d&dataFrom=0&dataSize=50&sortBy=dateDesc" \
  -H "Authorization: Bearer $KOMMON_POLL_API_KEY"

Production Notes

  • Start with GET /v4/list to confirm authentication and discover an aid.
  • Use GET /v4/search?aid=<AID> for overview analytics.
  • Add dataFrom and a positive dataSize when you need mention records.
  • Keep dataSize at or below 500.
  • Set duration and timezone explicitly for scheduled jobs.
  • Redact API keys and bearer headers from logs.