Brand Sentiment Analyzer

Use this template

Overview

This automation analyzes brand sentiment in online communities using AI. Give it a brand name, and it finds the most relevant Reddit communities to watch and prepares a sentiment report endpoint you can call from your tools. It’s built on FastAPI, uses AI behind the scenes (Gemini 2.5 via the CodeWords runtime), and is set up to expand into Twitter/X and LinkedIn sources. It’s a simple way to keep tabs on what people are saying about your brand—without manually hunting through posts.

Description

This automation turns a brand name into a sentiment report by combining social discussion sources into a single, structured output. It first uses AI technology to suggest the most relevant subreddits for that brand, then prepares a report endpoint you can call from your app or workflow. In parallel, it’s wired for future web crawling and social listening through your browser extension and a web crawler. After gathering the right communities to watch, it formats the result as a clean, markdown report so you can copy, share, or feed it into your dashboards for quick insights that guide marketing, support, and product decisions.

Key Features

AI subreddit discovery: Finds active, relevant Reddit communities for a given brand using Gemini 2.5 (flash) via the CodeWords runtime.

Simple API endpoint: One FastAPI POST endpoint (/) that accepts a brand name and returns a markdown report payload.

Structured outputs: Uses Pydantic models for clean, predictable request/response schemas you can rely on.

Ready for multi-source sentiment: Designed to expand to Reddit, Twitter/X, and LinkedIn by plugging in a web crawler and a browser extension.

Async-first design: Async OpenAI client and FastAPI make it fast and scalable for batch or on-demand use.

Built-in logging: CodeWords logger provides clear, contextual logs for each step of the analysis.

Environment-based config: Toggle behavior and credentials with environment variables, including an optional browser extension key for LinkedIn search.

Extensible codebase: Firecrawl and CodeWords clients are included to add real scraping, enrichment, and deeper analysis as you grow.

Instructions

1

Open the automation in CodeWords and add your environment values (API key, runtime URI, and optional browser extension key).

2

Start the automation and wait for the API to come online.

3

Send a POST request to/with a JSON body like { "brand_name": "Apple" }. You can do this from your app, Postman, or curl.

4

Check the response for the markdown sentiment report and the brand name you sent.

5

Review the suggested Reddit communities, and note ideas for adding Twitter/X or LinkedIn later.

6

Iterate as needed: adjust the brand name, try additional brands, or extend the code to pull real posts and update the report content.

Use Case

This automation is perfect for marketing and comms teams, founders, community managers, and product folks who want a quick, repeatable way to see where people talk about their brand and summarize the vibe. It’s great for weekly check-ins, launch monitoring, investor prep, or proactive support—without spending hours digging through threads.

Frequently Asked Questions

What does this automation do today versus later?

Today, it uses AI to suggest the most relevant subreddits for a brand and returns a markdown report payload. It’s structured to add real Reddit, Twitter/X, and LinkedIn content next, using a web crawler and a browser extension.

Which AI model does it use?

It calls Gemini 2.5 flash through the CodeWords runtime using the AsyncOpenAI client interface, so you get fast, low-latency suggestions.

Do I need Reddit, Twitter/X, or LinkedIn API keys?

Not for the current version. When you add live content ingestion, you can use the included web crawler and an optional browser extension key for LinkedIn-style browsing.

How accurate are the subreddit suggestions?

They’re generated by AI based on brand context and popular discussion spaces. You can review and refine them, or change the prompt and model if your use case is niche.

Why does the response show a sample report?

The endpoint currently returns a sample markdown report. It’s a scaffold so you can plug in real posts and sentiment scoring next.

Can I change how many subreddits it finds?

Yes. The internal function supports a max_subreddits parameter (default 6). You can expose it through the API request if you want users to control it.

How do I call the API?

Send a POST request to/with JSON like { "brand_name": "Nike" }. You’ll get a response with the brand name and a markdown report string.

Will this work without the browser extension key?

Yes. The key is optional and only needed when you add LinkedIn-style browsing or similar features.

Can I switch to a different AI model?

Absolutely. Update the model in the AI call (e.g., to another Gemini family model) and adjust temperature or prompts as needed.

Last updated