{"openapi":"3.0.0","info":{"title":"HomeStars Canada Contractors Directory","version":"1.0.0","description":"Canadian home improvement contractors, ratings, available phone numbers and reviews from HomeStars.com, one row per entity."},"servers":[{"url":"https://ah-homestars-com.opendata.best/s/homestars-com"}],"paths":{"/v1/search":{"post":{"operationId":"search","summary":"Search HomeStars Canada contractor listings","description":"","tags":["search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"searchType":{"type":"string","enum":["city-list","trade-city","national-trade","profile","all-cities","all-trades","privacy","about","home","search","map","login","quote","contact"],"description":"Search type. What to collect. Fill the matching field below: a city slug for city lists, trade plus city for trade lists, a profile slug or profile URLs for profiles. The last five types are not available on HomeStars and return an explanation instead of rows.","default":"city-list","example":"city-list"},"city":{"type":"string","description":"City slug. City slug exactly as in the HomeStars address, such as calgary-alberta or edmonton (from www.homestars.com/find-professionals/<city>).","example":"calgary-alberta"},"detailUrls":{"type":"array","items":{"type":"string"},"description":"Detail URLs. www.homestars.com addresses of city lists, trade lists, profiles or the privacy page. Each address is its own input with its own Max results. Other sites are not accepted."},"profileSlug":{"type":"string","description":"Profile slug. Profile slug exactly as in the HomeStars address, such as deo-tech or 2592882-a-action-furnace-inc (from www.homestars.com/profile/<slug>)."},"cluster":{"type":"string","description":"Content cluster. First part of a trade address, such as electricity, heating or roofing (www.homestars.com/<cluster>/<trade>-pros).","default":"electricity","example":"electricity"},"trade":{"type":"string","description":"Trade slug. Trade slug without -pros, such as electrician (www.homestars.com/electricity/electrician-pros).","default":"electrician","example":"electrician"},"market":{"type":"string","enum":["ca"],"description":"Market. Only Canada (www.homestars.com) is available.","default":"ca","example":"ca"},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"maxPages":{"type":"integer","minimum":1,"maximum":50,"description":"Max pages. Directory pages to read per input (up to 50).","default":1,"example":1},"enrichDetails":{"type":"boolean","description":"Enrich details. Enabled by default; these contact fields are empty on directory cards alone.","default":true,"example":true},"includeReviews":{"type":"boolean","description":"Include reviews","default":false,"example":false},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"searchType":"city-list","city":"calgary-alberta","cluster":"electricity","trade":"electrician","market":"ca","enrichDetails":true,"includeReviews":false,"maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"operationId":"health","summary":"API health check","description":"Lightweight readiness check for this API. Never starts a collection and always bills 0 rows.","tags":["health"],"responses":{"200":{"description":"API is operational (0 rows).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"503":{"description":"API is temporarily unavailable (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}}},"components":{"schemas":{"Row":{"type":"object","properties":{"name":{"nullable":true,"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"country":{"type":"string"},"authority":{"type":"string"},"rowType":{"type":"string","description":"Row type: list, profile, city, trade, privacy, about, home, review. Same value as kind and type."},"entityId":{"type":"string","description":"Stable typed key: servicePro:{id}, review:{reviewId}, trade:{trade}, city:{slug}, page:{privacy|about|home}."},"id":{"nullable":true,"type":"string","description":"Row id."},"serviceProId":{"nullable":true,"type":"integer","description":"Numeric HomeStars ServicePro node id on list/profile rows; null when the source page did not expose it."},"professionId":{"nullable":true},"reviewId":{"nullable":true,"type":"string"},"parentId":{"nullable":true,"type":"string"},"parentName":{"nullable":true,"type":"string"},"parentUrl":{"nullable":true,"type":"string"},"text":{"nullable":true,"type":"string","description":"Review rows: review body (HomeStars clientExperience)."},"rating":{"nullable":true},"reviewer":{"description":"Review rows: reviewer as published (name / object), null when anonymous."},"reply":{},"createdAt":{"nullable":true,"type":"string","description":"Review rows: review timestamp."},"url":{"nullable":true,"type":"string"},"kind":{"nullable":true,"type":"string"},"slug":{"nullable":true,"type":"string"},"listingTier":{"nullable":true,"type":"string"},"professions":{"type":"array","items":{}},"workArea":{"type":"object"},"reviewCount":{"nullable":true,"type":"integer"},"cluster":{"nullable":true,"type":"string"},"trade":{"nullable":true,"type":"string"},"phones":{"type":"array","items":{"type":"object"}},"emails":{"type":"array","items":{"type":"object"}},"address":{"type":"object","properties":{"street":{"nullable":true,"type":"string"},"unit":{"nullable":true,"type":"string"},"locality":{"nullable":true,"type":"string"},"region":{"nullable":true,"type":"string"},"postalCode":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"full":{"nullable":true,"type":"string"}}},"person":{"type":"object","properties":{"name":{"nullable":true,"type":"string"},"role":{"nullable":true,"type":"string"}}},"org":{"type":"object"},"leadSource":{"nullable":true,"type":"string"},"leadReveal":{"nullable":true,"type":"string"},"leadAbsences":{"type":"object"}},"additionalProperties":true,"description":"One collected entity. Field availability depends on rowType and the source. Fields always present (a|b = at least one of them): every row: id; rowType=profile: id, name, url."},"Error":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code","message","retryable"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string"},"retryable":{"type":"boolean"}}},"JobStatus":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","partial","failed","cancelled"]},"done":{"type":"boolean"},"rowsAvailable":{"type":"integer"},"rowsDelivered":{"type":"integer","description":"Rows already delivered (and billed) to you for this job."},"rowsLimit":{"type":"integer","description":"Most rows this job can deliver."},"estimatedFinishSec":{"type":"integer","description":"While running: estimated seconds until done."},"statusUrl":{"type":"string"},"resultsUrl":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"retentionHours":{"type":"integer"},"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"RowsPage":{"allOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"object","properties":{"offset":{"type":"integer"},"nextOffset":{"type":"integer"},"hasMore":{"type":"boolean"},"rowCount":{"type":"integer"},"rowsBilled":{"type":"integer","description":"Rows delivered by this response."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row"}},"meta":{"type":"object","additionalProperties":true}}}]},"HealthStatus":{"type":"object","required":["ok","site","status","endpoints","rowsBilled"],"properties":{"ok":{"type":"boolean"},"site":{"type":"string"},"status":{"type":"string","enum":["operational","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"rowsBilled":{"type":"integer"}}}}}}