{"openapi":"3.1.0","info":{"title":"ainea Business API","description":"Find tradespeople, lawyers, doctors and other service providers near a location or by company name. Public, rate-limited per IP (header X-RateLimit-Remaining). MCP endpoint: /mcp. Docs: https://ainea.org","version":"2.0"},"servers":[{"url":"https://api.ainea.org"}],"paths":{"/search":{"get":{"summary":"Search businesses near a location","description":"Finds tradespeople and other service providers near a location (Europe, North America). Default 1 result, up to 10 via 'limit'. Returns address, phone, email, website. If the location is ambiguous, 'candidates' are returned; search again with 'location_query'.","operationId":"search_businesses","parameters":[{"name":"activity","in":"query","required":true,"schema":{"type":"string","maxLength":100,"description":"Activity as free text in any language, e.g. plumber, roofer, employment lawyer. List: /categories","title":"Activity"},"description":"Activity as free text in any language, e.g. plumber, roofer, employment lawyer. List: /categories"},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Place, district or postcode, optionally with country/region, e.g. 'Manchester', '93047', 'Springfield, US-IL', 'Paris, FR'. Alternatively lat/lon","title":"Location"},"description":"Place, district or postcode, optionally with country/region, e.g. 'Manchester', '93047', 'Springfield, US-IL', 'Paris, FR'. Alternatively lat/lon"},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"ISO country code, e.g. GB, DE, US","title":"Country"},"description":"ISO country code, e.g. GB, DE, US"},{"name":"radius_km","in":"query","required":false,"schema":{"type":"number","maximum":100,"minimum":1,"description":"Search radius in km","default":30,"title":"Radius Km"},"description":"Search radius in km"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Number of results","default":1,"title":"Limit"},"description":"Number of results"},{"name":"lat","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":90,"minimum":-90},{"type":"null"}],"title":"Lat"}},{"name":"lon","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":180,"minimum":-180},{"type":"null"}],"title":"Lon"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/company":{"get":{"summary":"Find a business by name or website","description":"Finds a specific business by name or website (e.g. 'company.com') and returns address, phone, email, website. Optional location to narrow down; typos are tolerated.","operationId":"find_company","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":120,"description":"Company name (also partial) or website/domain, e.g. 'Smith Plumbing' or 'company.com'","title":"Name"},"description":"Company name (also partial) or website/domain, e.g. 'Smith Plumbing' or 'company.com'"},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Optional: place or postcode to narrow down","title":"Location"},"description":"Optional: place or postcode to narrow down"},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"Optional: ISO country code, e.g. DE","title":"Country"},"description":"Optional: ISO country code, e.g. DE"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Number of results","default":3,"title":"Limit"},"description":"Number of results"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/business/{id}":{"get":{"summary":"Details of a business","operationId":"get_business","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categories":{"get":{"summary":"List of searchable activities","operationId":"list_categories","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}