• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
nic

nic

OnboardCompany

Public
Like
OnboardCompany
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
7/11/2025
Viewing readonly version of main branch: v3
View latest version
README.md

Company Logo Finder API

This API endpoint helps you find company logos by searching their websites and using AI to extract the logo image URL from the HTML.

Endpoint

POST /find-logo

Request Body

{ "name": "Company Name", // Required: The company name "website": "https://...", // Optional: Company website URL "country": "Country Name", // Required: Company's country "state": "State/Province" // Optional: Company's state or province }

Response

Success Response (200)

{ "success": true, "logoUrl": "https://example.com/logo.png", "searchedUrl": "https://example.com" }

Error Response (400/404/500)

{ "success": false, "error": "Error description", "searchedUrl": "https://example.com" // Optional: URL that was searched }

How It Works

  1. Website Discovery: If no website is provided, the API searches DuckDuckGo to find the company's official website
  2. HTML Fetching: Retrieves the raw HTML from the company's homepage
  3. AI Logo Extraction: Uses OpenAI's GPT-4o-mini to analyze the HTML and locate the company logo
  4. URL Normalization: Converts relative URLs to absolute URLs for the logo image

Example Usage

With Website Provided

curl -X POST https://your-val-url/find-logo \ -H "Content-Type: application/json" \ -d '{ "name": "Apple Inc", "website": "https://apple.com", "country": "United States", "state": "California" }'

Without Website (Auto-Search)

curl -X POST https://your-val-url/find-logo \ -H "Content-Type: application/json" \ -d '{ "name": "Microsoft", "country": "United States", "state": "Washington" }'

Error Handling

The API handles various error scenarios:

  • Missing required fields (name, country)
  • Website not found during search
  • Website unreachable or returns errors
  • Logo not found in website HTML
  • AI service errors

Rate Limits

This API uses OpenAI's services, so it's subject to OpenAI's rate limits. For production use, consider implementing caching and rate limiting.

Technical Details

  • Built with Hono framework on Val Town
  • Uses OpenAI GPT-4o-mini for logo extraction
  • Supports both provided websites and automatic website discovery
  • Handles relative and absolute URL conversion
  • Includes proper error handling and logging
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.