DEV Community

Cover image for Detect Brand Logos in Images with a Logo Detection API
AI Engine
AI Engine

Posted on • Originally published at ai-engine.net

Detect Brand Logos in Images with a Logo Detection API

Brand logos appear in social media posts, product packaging, sports broadcasts, and storefronts. A logo detection API identifies them automatically — returning the brand name, confidence score, and bounding polygon coordinates.

Why Logo Detection?

  • Brand monitoring — Track where your logo appears across the internet, including visual-only mentions that text-based tools miss
  • Counterfeit detection — Scan e-commerce listings for unauthorized logo usage
  • Sponsorship tracking — Quantify logo screen time in broadcasts and events
  • Competitive intelligence — Benchmark your visual presence against competitors

Python Example

import requests

api_url = "https://logos-detection.p.rapidapi.com/detect-logo"
headers = {
    "x-rapidapi-host": "logos-detection.p.rapidapi.com",
    "x-rapidapi-key": "YOUR_API_KEY",
}

response = requests.post(
    api_url,
    headers={**headers, "Content-Type": "application/x-www-form-urlencoded"},
    data={"url": "https://example.com/photo.jpg"},
)

data = response.json()

for logo in data["body"]["logos"]:
    name = logo["description"]
    score = logo["score"]
    coords = ", ".join(f"({v['x']}, {v['y']})" for v in logo["boundingPoly"])
    print(f"{name} (confidence: {score:.0%}) at [{coords}]")
Enter fullscreen mode Exit fullscreen mode

Response Format

{
  "statusCode": 200,
  "body": {
    "logos": [
      {
        "description": "Apple",
        "score": 0.65,
        "boundingPoly": [
          { "x": 349, "y": 529 },
          { "x": 402, "y": 529 },
          { "x": 402, "y": 601 },
          { "x": 349, "y": 601 }
        ]
      }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Each detection includes the brand name, confidence score, and a bounding polygon for exact logo location.

Tips

  • Use images where logos are at least 50px wide for reliable detection
  • Filter by confidence score — 0.6+ for dashboards, 0.85+ for automated takedowns
  • Handle multiple logos per image (sports/events often have dozens)
  • Use bounding polygons to draw visual overlays for QA dashboards

👉 Read the full tutorial with cURL, JavaScript examples and more use cases

Top comments (0)