🔭 Supplier Scout
Find suppliers of goods and services, including the ones that are not online, by typing what you need in your own words.
Live map search · real order cost · fair ratings · trust from referrals · human review · optional Claude agent.
▶ Live demo · How it works · Cómo funciona (español) · 🇪🇸 Resumen en español · Playbook: suppliers that are not online · Countries and languages
The problem
Finding a new supplier usually means a web search, a spreadsheet and a few phone calls. Three things go wrong:
- The best suppliers are often not on the web. Small workshops, family businesses and distributors who sell by phone or WhatsApp have no website. A colleague knows them, a current supplier buys from them, or they are in a public registry or on a community map. Web search never shows them.
- The cheapest list price is rarely the cheapest order. Pack sizes, minimum orders, tax, shipping and payment terms change the total. A $2,100 box with a 1,000-unit minimum and 10-day delivery loses to a $2,600 box delivered in 2 days.
- Star ratings mislead. A 5.0 from 2 reviews beats a 4.7 from 300, and a supplier with no online reviews looks worse than one with bad reviews.
The full walkthrough, from the live map search to how the ranking decides, is in How it works (español).
What it does
- Understands what you need, in your own words, and finds real businesses on the map. Type air conditioning maintenance, plumber, fire extinguisher refill or cardboard boxes plus a neighbourhood and a city. Rules (no AI) turn the request into OpenStreetMap tags and words found in business names, for 27 trades and services and 12 purchase categories in four languages, with regional words (gasfitero, refaccionaria, tlapalería, gomería, borracharia, desentupidora), and the app says what it understood. Places are identified the way buyers name them: a whole town or city (Barranquilla, San Gil), a neighbourhood, or the browser's location; towns that share a name are told apart by region and offered as alternatives, and a place typed with the wrong country is found anyway. The demo searches OpenStreetMap, the community map where many shops and workshops with no website are listed, reports how many have no website, links every result to its map entry, and opens the same search in Google Maps with one click (an official link: no key, no scraping).
- Searches by location. Distance from your delivery point, a search radius, and suppliers that deliver are kept even when they are far.
- No quantities to find options. Purchasing starts by gathering several options and negotiates amounts later, so the search ranks by quoted unit price (when there is one), distance, ratings, trust and speed. Quote requests for a service ask for the price of the job, what it includes and the response time. Once quotes arrive, the Quotes tab turns each one into the real cost of an order: whole packs, the minimum order, tax, shipping, your currency (at a rate you set) and, optionally, the value of paying later.
- Rates fairly. A Bayesian average of online reviews and your own team's reviews. No reviews means "unknown", not "bad".
- Shows them on a real map, with driving times. An OpenStreetMap map (no library, tiles only for the area in view) with the search radius and numbered markers that jump to each card; in a live search, one OSRM request adds the approximate driving time and road distance to every business. Each card has Call, its address and opening hours, its map entry and a Google Maps search.
- Follows how purchasing actually decides. Filters for with phone and no website and a nearest order; a shortlist (My list) that keeps the suppliers to contact with their status (to contact, contacted, quoted, chosen, discarded), shows progress towards the usual three quotes, sends one personalised quote request to everyone still pending over WhatsApp or email (a one-to-many request, as in Thomasnet, over the channel the region uses), links each supplier to its country's official registry and tax portals (RUES and DIAN, SAT, SUNAT, SII, ARCA, SRI, Receita Federal), and downloads a comparison table (cuadro comparativo) for Excel or Sheets with price, lead time, payment terms, warranty and notes. Quote requests can include the documents needed to register a supplier (in Colombia: RUT, Chamber of Commerce certificate, bank certificate, legal representative's ID).
- Finds and records offline suppliers. Community maps and public registries (connectors), fair and chamber-of-commerce lists (CSV), business cards and WhatsApp messages (a parser that runs in the browser), and referrals from people you trust.
- Keeps a human in the loop. New captures and ambiguous duplicates go to a review queue. Quote requests and referral requests are drafted for you to send; nothing is sent automatically.
- Explains every position. Each result says why: order total, adjusted rating, distance, trust, lead time, and warnings (no quote yet, misses the deadline, over budget, unverified).
- Optional Claude agent. Describe what you need in plain language; the agent searches your list, the map and the registry, ranks the candidates and drafts the messages.
- Works across Latin America and beyond. Spanish-speaking Latin America, Brazil, Spain, Portugal, France and the US have country profiles, and the whole app speaks Spanish, English, Portuguese and French. Details.
Finding suppliers that are not online
This is the core of the project. The full guide is in the playbook.
| Channel | How Supplier Scout helps |
|---|---|
| Referrals from current suppliers and colleagues | Drafts the "who do you buy this from?" message; records who recommended whom; counts only independent referrals toward trust |
| Public registries (procurement, chambers of commerce) | SECOP II connector for Colombia; an OCDS connector for every government that publishes open contracting data; any Socrata open-data portal; CSV import for any other registry. The app lists each country's procurement portal and business registry |
| Community maps | Live OpenStreetMap search in the web app and a connector in the CLI, for any country, reporting how many results have no website; a one-click Google Maps search for the businesses OSM does not have |
| Trade districts and fairs | CSV import that recognises columns by name in Spanish, English, Portuguese and French |
| Business cards, flyers, WhatsApp | Rule-based parser: name, tax ID with check digit, phones, emails, handles, address, prices, pack size, minimum order, lead time, payment terms |
| Verification | Tax-ID check digits, verification levels (contacted → formal → visited → bought from), human review queue |
How the ranking works
| Factor | What it measures | When data is missing |
|---|---|---|
| Price | Quoted unit price with tax relative to the cheapest option; in the Quotes tab, the total cost of an order (packs, minimum, tax, shipping, currency, payment term) | Neutral + "ask for a quote" |
| Rating | Bayesian blend: a neutral prior worth 5 reviews, online reviews (capped at 100), team reviews ×3 | Neutral |
| Distance | Inside your radius; suppliers that deliver keep a floor | Neutral |
| Trust | Verification level + independent referrals (self and same-group referrals ignored, mutual ones count half) | Lowest level |
| Speed | Lead time; a hard warning if it misses your deadline | Neutral |
Weights are presets (balanced, cheapest, most reliable, nearest, urgent) or sliders.
Countries and languages
Built in Colombia, meant for Latin America, usable anywhere. The full table is in docs/countries.md.
- 23 country profiles + a generic one: the 17 Spanish-speaking countries of Latin America from Mexico to Argentina (Cuba uses the generic profile), plus Puerto Rico, Brazil, Spain, Portugal, France and the US. Each one knows its currency, its sales tax name and default rate (IVA, IGV, ITBIS, ITBMS, ISV, IVU, TVA), its tax ID, its phone habits and where formal suppliers are listed (procurement portal, business registry, data-protection law).
- Tax-ID check digits in 13 countries, including Brazil's alphanumeric CNPJ (from July 2026). Where no public check-digit rule exists (Mexico's RFC, Venezuela's RIF, most of Central America), the ID is checked for format and the app says "format only" instead of "valid".
- How suppliers actually write: Argentina's "15" mobiles, Mexico's old "044", RD$, quetzales, colones, guaraníes, "+ IGV", "com impostos", "HT", an arroba (12.5 kg in Colombia, 15 kg in Brazil), tlapalería or ferragens, and addresses by landmark ("100 varas al sur").
- Four languages: the web app, the explanation of every ranking, the quote and referral requests (which name the local tax: "¿incluye IGV?") and the agent. The app follows the browser's language.
- Sample data for Bogotá, Mexico City and São Paulo.
Design decisions
- Missing data is neutral, never zero. This is what lets an offline supplier with no reviews and no quote yet compete with a web shop, while still showing what to ask for.
- Precision over recall for duplicates. Same tax ID, phone, email or corporate domain merges automatically; a similar name alone always goes to a person. Two different valid tax IDs are never merged, even with a shared phone.
- The agent cannot invent suppliers. The output file contains only suppliers a tool returned. Whatever the model writes is used for the summary and the drafts, not as data.
- One logic, three front ends.
src/coreis plain JavaScript with no dependencies. The browser demo, the CLI and the agent run the same code, and the tests cover it. - Country-agnostic by configuration. A country is one profile: currency, default sales tax, tax-ID rules, phone habits and local weights. Adding one touches no other file. Local details are respected: a "libra" in a Colombian market is 500 g, and a regional unit always asks for confirmation.
- Honest validation. A tax ID is "valid" only when a check digit proves it; otherwise the app says "format only". A label shared by several countries ("RUC" is used in five) switches country only on a verified check digit, never on a guess.
- No AI where rules are enough. Card and WhatsApp parsing is rule-based, runs offline and is predictable. The model is used only where it adds something: planning a search from a plain-language request.
The AI agent
agent/ uses the Claude API (official @anthropic-ai/sdk, model claude-opus-5-5 by default) with seven read-only tools: find_coordinates, search_my_database, search_map, search_public_registry (Colombia), search_google_places (only if you set a key), rank_candidates and draft_messages.
- It only reads and drafts. There is no tool to send messages, write files or browse arbitrary pages. You review and send.
- Data minimisation. Phone numbers and emails never go to the model; WhatsApp links for the drafts are filled in locally. Suppliers who refused consent for their personal data are ranked locally but never described to the model.
- Cost control. At most 12 steps per run, effort
medium, prompt caching, and token usage printed at the end. - Safety. Tool results are treated as data, not instructions (a business name on a map could contain text meant to manipulate the model). If a safety classifier declines a request, the API's server-side fallback retries on its recommended model (
fallbacks: "default"). --dry-runruns the same tools in a fixed order without AI or a key, to try it or compare.- Language:
--lang es|en|pt|fr; by default, the language of the country (--country BRanswers in Portuguese).
Security
| Risk | Mitigation |
|---|---|
| AI invents suppliers, prices or reviews | Candidates come only from tool results; the loop is tested with a scripted model that tries to invent one |
| Prompt injection through third-party data (names, notes) | Tools are read-only; no send or write tools; the system prompt marks tool output as data; a person sends every message |
| Personal data sent to the AI provider | Tool results strip phones and emails (tested) |
| API keys leaking | Keys only in environment variables (.env is git-ignored, .env.example is empty); the Places key goes in a header, never the URL (tested) |
| Query injection (Overpass QL, SoQL) | User text is reduced to letters and digits before building map queries; SoQL string literals are escaped (tested) |
Malicious import file (XSS, javascript: links, huge files) |
One sanitising gate for all external data (also applied to what the browser saved, since storage is shared by every page on the same GitHub Pages domain); http(s) links only; 2 MB limit; the page renders with textContent only |
| Huge or hostile inputs (availability) | Capture text capped at 5,000 characters and tested against regex backtracking; imports capped at 2,000 suppliers; duplicate search and ranking tested to stay fast at those limits; connector responses capped at 5 MB while streaming |
| Spreadsheet formula injection in the CSV export | Cells starting with =, +, -, @ are exported as text (tested) |
| Demo page | Strict CSP: scripts, styles and fonts (IBM Plex, self-hosted, SIL Open Font License) come from the site itself; connect-src allows only Nominatim, Overpass and the OSRM routing server, used only when you press Search the map, and img-src only OpenStreetMap's tiles (tested). Marker colours are set through the CSSOM because inline style attributes are blocked. No cookies or trackers. Map results go through the same sanitising gate as any import; the shortlist and recent places read back from storage are checked the same way |
| Personal data of sole traders (Colombia: Law 1581 of 2012; LGPD in Brazil and similar laws across the region) | Consent checkbox on capture that names the selected country's law, warning in the ranking when consent was refused, never sent to the AI agent when refused, data stays in the browser unless exported. The OCDS connector imports the business, never the contact person's name (tested) |
| Leaking real data from this public repo | All data is fictional: .example domains, phones in unassigned ranges (Colombia 999, Mexico 55 0000, Brazil (11) 0000, or ranges reserved for fiction), tax IDs generated with a correct check digit. Tests enforce it |
| CI supply chain | Read-only permissions, no persisted credentials, every GitHub Action pinned to a commit SHA (tested; Dependabot updates the pins), npm ci --ignore-scripts, one runtime dependency (the official SDK, used only by the agent), Dependabot for security updates |
| Script injection through map data | Trusted Types enforced by the CSP (require-trusted-types-for 'script'), no HTML-string sinks anywhere in the web app (tested), every value rendered with textContent |
| Abuse of free services and location privacy | Nominatim and OSRM calls queued to at most one per second across searches (tested); the browser location is rounded to about 100 m before it is sent |
| Wrong but real results | Map tags checked against the OpenStreetMap wiki; name words that caught unrelated businesses (kindergartens, banks, universities) narrowed, with tests |
| Terms of the data sources | OSM and Nominatim: attribution, one geocoding call per search (a second one a second later only when the place is not in the chosen country), no search-as-you-type, a 10 km radius cap and the button disabled while a search runs (the CLI also sends an identifying User-Agent); OSM tiles: attribution on the map, a Referer on every tile request (the page otherwise sends none), only the tiles in view; OSRM demo server: one table request per search, at most 100 places, non-commercial use, credited; Overpass: one retry after 3 s when busy, no unverified mirrors (some serve stale data silently); Google Maps: only an official search link, nothing is copied and no Google data is shown on the OSM map (against Google's terms); Google Places (CLI, your own key): records are flagged for refresh or deletion per Google's terms |
Architecture
flowchart LR
subgraph S[Where suppliers come from]
MAP[OpenStreetMap]
REG[Public registries<br/>SECOP · OCDS · Socrata portals]
GP[Google Places<br/>optional key]
CSV[CSV<br/>fairs · chambers · sheets]
CARD[Cards · flyers · WhatsApp]
REF[Referrals]
end
MAP --> CON[Connectors · Node]
REG --> CON
GP --> CON
CSV --> CON
CARD --> PAR[Capture parser<br/>rules · offline]
REF --> PAR
CON --> GATE[(Common format<br/>sanitised)]
PAR --> REV{Human review}
GATE --> DUP{Duplicates<br/>confidence tiers}
DUP -->|exact · high · medium| DB[(Supplier list)]
DUP -->|low · conflict| REV
REV --> DB
DB --> RANK[Ranking<br/>order cost · fair rating<br/>distance · trust · speed]
RANK --> WEB[Web app]
RANK --> AG[Claude agent]
AG -.->|drafts only| YOU[You send quote<br/>and referral requests]
Project structure
src/core/ shared logic, no dependencies (browser + Node)
services.js what the buyer typed -> trades, categories, map tags and name words (rules, ES/EN/PT/FR)
osm.js OpenStreetMap query and parsing, place disambiguation and search radius, Google Maps search link
shortlist.js the buyer's shortlist: statuses, three-quote progress, comparison table (CSV)
countries.js 23 country profiles: currency, tax, tax-ID check digits, phone habits, registries
capture.js business card / flyer / WhatsApp text -> draft supplier
quotes.js units, packs, minimum order, tax, shipping, FX, payment terms
reviews.js Bayesian rating blend
trust.js verification levels and referral counting
dedupe.js duplicate detection with confidence tiers, merging
score.js explainable ranking
csv.js · schema.js import/export and the sanitising gate
messages.js explanations (ES / EN / PT / FR) · outreach.js quote & referral drafts
src/connectors/ OpenStreetMap, Socrata/SECOP, OCDS, Google Places, Nominatim (Node)
src/data/ fictional demo data (Bogotá, Mexico City and São Paulo)
cli/scout.js connectors, CSV import, merge and rank from the terminal (args.js: shared parser)
agent/ Claude agent: tools, loop, system prompt, CLI
demo/ the web app (GitHub Pages): app.js, live.js (the only file that uses the network), map.js (OSM tiles + markers,
no library), i18n.js (ES/EN/PT/FR texts), self-hosted IBM Plex fonts
tests/ 179 tests: core, regional formats, connectors against API-shaped fixtures,
CLI, agent loop with a scripted model, demo security guards
docs/ how it works (ES/EN), screenshots
