Skip to main content

How Can I Use the API for Real-Time Brand Tracking?

Updated over a month ago

Real time brand tracking with the BrandMentions API lets you:

  • Spot crises as they start

  • Respond quickly to customer issues

  • Detect trends and viral conversations early

  • Monitor competitors in near real time

Instead of refreshing the BrandMentions interface or running manual exports, you can stream mentions directly into your own tools as they are discovered.

To use the BrandMentions API for real time brand tracking:

  1. Create a webhook endpoint on your server that can receive POST requests.

  2. Pass your webhook URL as the callback parameter when creating projects.

  3. Use callback payloads to call GetProjectMentions, GetMentions, and fetch fresh mentions.

  4. Trigger real time actions, such as alerts, tickets, CRM updates, or live dashboard updates.

  5. Optionally add light polling as a backup for resilience.

Step by step: setting up real time tracking with callbacks

1. Create a webhook endpoint on your server

First, you need a URL that can receive HTTP POST requests from BrandMentions.

Key requirements:

  • Publicly accessible over HTTPS

  • Accepts POST requests

  • Can parse JSON payloads

You can implement this in any backend stack, for example:

  • Node.js (Express, Fastify)

  • Python (Flask, FastAPI, Django)

  • PHP (Laravel, Symfony)

  • Ruby, Go, Java, etc.

Example in pseudo code:

POST https://yourserver.com/brandmentions-webhook Body: JSON with identification data (for example search_hash or project_id)

At minimum, your endpoint should:

  • Validate that the request is authentic (for example by checking a secret or IP whitelist if available)

  • Log the data for debugging

  • Trigger your internal processing logic

2. Pass your webhook URL as the callback parameter

When you create a project or run an on the spot search through the API, include your webhook URL in the callback field.

Example for a project:

https://api.brandmentions.com/command.php   ?api_key=YOUR_API_KEY   &command=AddProject   &keyword1=mybrand   &callback=https://yourserver.com/brandmentions-webhook

Example for an on the spot search:

https://api.brandmentions.com/command.php   ?api_key=YOUR_API_KEY   &command=PostSearch   &keyword1=mybrand   &time_range=day   &callback=https://yourserver.com/brandmentions-webhook

What happens:

  • The project or search job is created and processed by BrandMentions.

  • After processing is finished (and, depending on the configuration, as mentions are available), BrandMentions sends a POST request to your callback URL.

The callback payload typically includes identifiers such as:

  • project_id for project based operations

  • search_hash for on the spot searches

You then use those identifiers to fetch the actual data in the next step.

3. Receive the callback and fetch mentions

When your endpoint receives a callback, the typical flow is:

  1. Read the JSON body.

  2. Extract the project_id or search_hash.

  3. Call the appropriate API endpoint to get mentions.

For example:

  • If the callback refers to a project:

    • Call GetProjectMentions with the project_id and a time filter for recent mentions.

  • If the callback refers to an on the spot search:

    • Call GetMentions or GetProcessedMentions with the search_hash.

You can then:

  • Insert the mentions into a database.

  • Feed them into a streaming system (for example Kafka, Pub/Sub).

  • Forward them directly to other tools such as Slack or a ticketing system.

4. Trigger real time actions from new mentions

Once you have new mentions flowing into your system, you can use your own rules to trigger actions.

Some common real time workflows:

  • Alerts in Slack or Teams

    • Send negative or high reach mentions to a specific channel.

    • Include sentiment, reach, and a direct link to the source.

  • Customer support tickets

    • Create a ticket in Zendesk, Freshdesk, or your custom help desk when a complaint is detected.

    • Attach the full text and URL of the mention for context.

  • CRM tasks and follow ups

    • For positive or influential mentions, create tasks for sales or success teams to follow up.

  • Live dashboards

    • Push mentions into a real time dashboard (for example a React or Vue app backed by WebSockets).

    • Show mention streams, sentiment gauges, and live counts.

Because the BrandMentions API delivers data as soon as it is processed, your system can react within seconds.

Benefits of real time brand tracking with the API

Real time brand tracking is not only about speed. It changes how your organization reacts and plans.

Crisis management

  • Detect negative spikes as they start.

  • Escalate severe issues to PR and legal teams immediately.

  • Monitor the impact of your responses in real time.

Customer engagement

  • Reply to questions and complaints while the user is still active.

  • Turn public issues into visible wins by responding quickly and transparently.

Trend spotting

  • Catch viral posts and topics early.

  • Identify new influencers and emerging communities that talk about your brand.

  • Use the data to plan content, campaigns, and product improvements.

Competitive intelligence

  • Monitor competitor mentions with the same logic.

  • See how the market reacts to their announcements and campaigns, in real time.

With this setup, the BrandMentions API becomes the real time engine behind your monitoring, engagement, and intelligence workflows.

Did this answer your question?