> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.gorilladash.com/gorilla-dash-rest-ful-api/tribes/get-tribe-search/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.gorilladash.com/_mcp/server. # Get Tribe Search POST https://api.gorilladash.com/api/v1/tribes/search Content-Type: application/json Find the right tribe for a visitor — the endpoint behind a store finder. **Organisation keys only.** A tribe key gets **403 `Tribe is not supported`** (it is already scoped to one tribe, so there is nothing to search). This endpoint has **two completely different modes**, chosen by what you send: ### 1. Direct lookup Send any of `tribe_id`, `tribe_slug` or `global_id` and it becomes an exact-match lookup over the organisation's **Active** tribes. Multiple selectors are ANDed. No geocoding, no distance, no `results` limit — you get whatever matches. ### 2. Proximity search Send `address` (which gets geocoded) **or** `latitude` + `longitude`, optionally narrowed by a `name` substring, and capped by `results` (default **5**). The search runs in two phases and stops as soon as it has enough: 1. **Territory first** — tribes whose drawn territory polygon contains the point, plus tribes whose `territory_post_codes` list includes the address's postcode. Deduplicated and sorted by distance. If this alone fills `results`, the search stops here. 2. **Then nearest** — the closest remaining tribes by great-circle distance, appended in distance order until `results` is reached. So a tribe that owns the territory outranks a tribe that is physically closer. That is deliberate: franchise territory beats raw proximity. **When the address will not geocode** (`N/A`, a typo, a place that does not exist) the endpoint does **not** error and does **not** return whatever sits nearest to (0, 0). It falls back to the organisation's designated fallback tribe — optionally still filtered by `name` — so a store finder stays populated. **Response** — an array of tribes in the same shape as `GET /tribes`, including the effective `website_number_swap_enabled`. There is no pagination block. Success is HTTP **201**. Reference: https://docs.gorilladash.com/gorilla-dash-rest-ful-api/tribes/get-tribe-search ## Request ### Query parameters - `results` (integer, optional) — Max tribes to return in proximity mode. Default 5. Ignored by direct lookup. ### Headers - `GorillaDash-Api-Key` (string, optional) — Gorilla Dash API Key - `GorillaDash-Api-Secret` (string, optional) — Gorilla Dash API Secret - `X-Requested-With` (string, optional) ### Body (application/json) This endpoint expects a string. - `string` ## Response ### 201 Created - `status` (integer, required) - `success` (boolean, required) - `data` (list of ApiV1TribesSearchPostResponsesContentApplicationJsonSchemaDataItems, required) ## Types ### ApiV1TribesSearchPostResponsesContentApplicationJsonSchemaDataItems - `id` (integer, required) - `organisation_id` (integer, required) - `name` (string, required) - `slug` (string, required) - `status` (string, required) - `country` (string, required) - `postal_code` (string, required) - `state` (string, required) - `state_abbreviated` (string, required) - `locality` (string, required) - `address_1` (string, required) - `latitude` (integer, required) - `longitude` (integer, required) - `main_telephone` (string, required) - `paid_number` (string, required) - `paid_number_e164` (string, required) - `organic_number` (string, required) - `organic_number_e164` (string, required) - `website_number_swap_enabled` (boolean, required) - `opening_hours_array` (ApiV1TribesSearchPostResponsesContentApplicationJsonSchemaDataItemsOpeningHoursArray, required) - `square_url` (string, required) - `global_id` (any, optional) - `address_2` (any, optional) ### ApiV1TribesSearchPostResponsesContentApplicationJsonSchemaDataItemsOpeningHoursArray - `monday` (string, required) - `tuesday` (string, required) - `wednesday` (string, required) - `thursday` (string, required) - `friday` (string, required) - `saturday` (any, optional) - `sunday` (any, optional) ## Examples **Request** ```json "{\n // \"name\": \"Gladesville\", // search by name\n // \"tribe_id\": 1, // search by tribe id\n // \"tribe_slug\": \"\", // search by tribe slug\n // \"global_id\": \"\", // search by tribe global id\n \"address\": \"Lynnfield, MA 01940\" // search by address\n // \"latitude\": \"-33.82763350\", // search by latitude\n // \"longitude\": \"151.12609270\" // search by longtitude\n}" ``` **Response** ```json { "status": 201, "success": true, "data": [ { "id": 1, "organisation_id": 1, "name": "Demo", "slug": "demo", "status": "Active", "country": "Australia", "postal_code": "2111", "state": "New South Wales", "state_abbreviated": "NSW", "locality": "Gladesville", "address_1": "Buffalo Road", "latitude": -33, "longitude": 151, "main_telephone": "(02) 9999 0000", "paid_number": "(02) 9999 0111", "paid_number_e164": "+61299990111", "organic_number": "(02) 9999 0000", "organic_number_e164": "+61299990000", "website_number_swap_enabled": true, "opening_hours_array": { "monday": "09:00-17:00", "tuesday": "09:00-17:00", "wednesday": "09:00-17:00", "thursday": "09:00-17:00", "friday": "09:00-16:00" }, "square_url": "https://cdn.gorilladash.com/images/media/15717787/demo-square-673c4aca9c8ff.jpg" } ] } ``` **SDK Code** ```python Tribes_Get Tribe Search_example import requests url = "https://api.gorilladash.com/api/v1/tribes/search" querystring = {"results":"10"} payload = "{ // \"name\": \"Gladesville\", // search by name // \"tribe_id\": 1, // search by tribe id // \"tribe_slug\": \"\", // search by tribe slug // \"global_id\": \"\", // search by tribe global id \"address\": \"Lynnfield, MA 01940\" // search by address // \"latitude\": \"-33.82763350\", // search by latitude // \"longitude\": \"151.12609270\" // search by longtitude }" headers = { "GorillaDash-Api-Key": "{{API_KEY}}", "GorillaDash-Api-Secret": "{{GD_RESTFUL_SECRET}}", "X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers, params=querystring) print(response.json()) ``` ```javascript Tribes_Get Tribe Search_example const url = 'https://api.gorilladash.com/api/v1/tribes/search?results=10'; const options = { method: 'POST', headers: { 'GorillaDash-Api-Key': '{{API_KEY}}', 'GorillaDash-Api-Secret': '{{GD_RESTFUL_SECRET}}', 'X-Requested-With': 'XMLHttpRequest', 'Content-Type': 'application/json' }, body: '"{\n // \"name\": \"Gladesville\", // search by name\n // \"tribe_id\": 1, // search by tribe id\n // \"tribe_slug\": \"\", // search by tribe slug\n // \"global_id\": \"\", // search by tribe global id\n \"address\": \"Lynnfield, MA 01940\" // search by address\n // \"latitude\": \"-33.82763350\", // search by latitude\n // \"longitude\": \"151.12609270\" // search by longtitude\n}"' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Tribes_Get Tribe Search_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.gorilladash.com/api/v1/tribes/search?results=10" payload := strings.NewReader("\"{\\n // \\\"name\\\": \\\"Gladesville\\\", // search by name\\n // \\\"tribe_id\\\": 1, // search by tribe id\\n // \\\"tribe_slug\\\": \\\"\\\", // search by tribe slug\\n // \\\"global_id\\\": \\\"\\\", // search by tribe global id\\n \\\"address\\\": \\\"Lynnfield, MA 01940\\\" // search by address\\n // \\\"latitude\\\": \\\"-33.82763350\\\", // search by latitude\\n // \\\"longitude\\\": \\\"151.12609270\\\" // search by longtitude\\n}\"") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("GorillaDash-Api-Key", "{{API_KEY}}") req.Header.Add("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}") req.Header.Add("X-Requested-With", "XMLHttpRequest") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Tribes_Get Tribe Search_example require 'uri' require 'net/http' url = URI("https://api.gorilladash.com/api/v1/tribes/search?results=10") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["GorillaDash-Api-Key"] = '{{API_KEY}}' request["GorillaDash-Api-Secret"] = '{{GD_RESTFUL_SECRET}}' request["X-Requested-With"] = 'XMLHttpRequest' request["Content-Type"] = 'application/json' request.body = "\"{\\n // \\\"name\\\": \\\"Gladesville\\\", // search by name\\n // \\\"tribe_id\\\": 1, // search by tribe id\\n // \\\"tribe_slug\\\": \\\"\\\", // search by tribe slug\\n // \\\"global_id\\\": \\\"\\\", // search by tribe global id\\n \\\"address\\\": \\\"Lynnfield, MA 01940\\\" // search by address\\n // \\\"latitude\\\": \\\"-33.82763350\\\", // search by latitude\\n // \\\"longitude\\\": \\\"151.12609270\\\" // search by longtitude\\n}\"" response = http.request(request) puts response.read_body ``` ```java Tribes_Get Tribe Search_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.gorilladash.com/api/v1/tribes/search?results=10") .header("GorillaDash-Api-Key", "{{API_KEY}}") .header("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}") .header("X-Requested-With", "XMLHttpRequest") .header("Content-Type", "application/json") .body("\"{\\n // \\\"name\\\": \\\"Gladesville\\\", // search by name\\n // \\\"tribe_id\\\": 1, // search by tribe id\\n // \\\"tribe_slug\\\": \\\"\\\", // search by tribe slug\\n // \\\"global_id\\\": \\\"\\\", // search by tribe global id\\n \\\"address\\\": \\\"Lynnfield, MA 01940\\\" // search by address\\n // \\\"latitude\\\": \\\"-33.82763350\\\", // search by latitude\\n // \\\"longitude\\\": \\\"151.12609270\\\" // search by longtitude\\n}\"") .asString(); ``` ```php Tribes_Get Tribe Search_example request('POST', 'https://api.gorilladash.com/api/v1/tribes/search?results=10', [ 'body' => '"{\\n // \\"name\\": \\"Gladesville\\", // search by name\\n // \\"tribe_id\\": 1, // search by tribe id\\n // \\"tribe_slug\\": \\"\\", // search by tribe slug\\n // \\"global_id\\": \\"\\", // search by tribe global id\\n \\"address\\": \\"Lynnfield, MA 01940\\" // search by address\\n // \\"latitude\\": \\"-33.82763350\\", // search by latitude\\n // \\"longitude\\": \\"151.12609270\\" // search by longtitude\\n}"', 'headers' => [ 'Content-Type' => 'application/json', 'GorillaDash-Api-Key' => '{{API_KEY}}', 'GorillaDash-Api-Secret' => '{{GD_RESTFUL_SECRET}}', 'X-Requested-With' => 'XMLHttpRequest', ], ]); echo $response->getBody(); ``` ```csharp Tribes_Get Tribe Search_example using RestSharp; var client = new RestClient("https://api.gorilladash.com/api/v1/tribes/search?results=10"); var request = new RestRequest(Method.POST); request.AddHeader("GorillaDash-Api-Key", "{{API_KEY}}"); request.AddHeader("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}"); request.AddHeader("X-Requested-With", "XMLHttpRequest"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "\"{\\n // \\\"name\\\": \\\"Gladesville\\\", // search by name\\n // \\\"tribe_id\\\": 1, // search by tribe id\\n // \\\"tribe_slug\\\": \\\"\\\", // search by tribe slug\\n // \\\"global_id\\\": \\\"\\\", // search by tribe global id\\n \\\"address\\\": \\\"Lynnfield, MA 01940\\\" // search by address\\n // \\\"latitude\\\": \\\"-33.82763350\\\", // search by latitude\\n // \\\"longitude\\\": \\\"151.12609270\\\" // search by longtitude\\n}\"", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Tribes_Get Tribe Search_example import Foundation let headers = [ "GorillaDash-Api-Key": "{{API_KEY}}", "GorillaDash-Api-Secret": "{{GD_RESTFUL_SECRET}}", "X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json" ] let parameters = "{ // \"name\": \"Gladesville\", // search by name // \"tribe_id\": 1, // search by tribe id // \"tribe_slug\": \"\", // search by tribe slug // \"global_id\": \"\", // search by tribe global id \"address\": \"Lynnfield, MA 01940\" // search by address // \"latitude\": \"-33.82763350\", // search by latitude // \"longitude\": \"151.12609270\" // search by longtitude }" as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.gorilladash.com/api/v1/tribes/search?results=10")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```