---
title: "Search facilities, the user's country first"
method: GET
path: "/v1/facilities/search"
tags: ["Facilities"]
---

# Search facilities, the user's country first

`GET /v1/facilities/search`

## Request

- Base URL: `https://api.hify.club`
- URL: `https://api.hify.club/v1/facilities/search`
- Auth: API key in header `X-User-Token`

One ranked stream of matches with the preferred country's facilities ahead of every other country, cut into pages. Each page is split into `facilities` (preferred country) and `other_facilities` (everyone else). The preferred country is `country` when given, otherwise the player's own; an admin without `country` has none, and then everything is under `facilities`. An unknown `country` is a 400.

## Query parameters

- `q` string, required
- `lat` number
- `lng` number
- `country` string
- `page` integer
- `per_page` integer

## Response `200`

A page of matches split by country; X-Total-Count and X-Total-Pages describe the whole stream

- object
  - `facilities` object[]
  - `other_facilities` object[]
  - `pagination` object
    - `page` integer
    - `per_page` integer
    - `total_count` integer: Matches across every country
    - `country_count` integer: Matches in the preferred country

---

[API](https://skmtc.dev/hify/apis/hify-apis.md) - [All operations](https://skmtc.dev/hify/apis/hify-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/hify/apis/hify-apis/revisions/b5920403538d?raw)
