ورود | ثبت نام
  • FA
  • EN

API Docs

GET /api/v1/gyms

Retrieves a list of gyms, with support for filtering by location, owner, major, and more. Results can be sorted by proximity, marketing boosts, or recency.

No authentication required.


Permissions

PermissionDescription
gyms.view_allView all gyms, including hidden ones (admin only). Without this permission, only gyms that are active and have an approved license are returned, except users can always see their own gyms in any state. Also required for the license_status filter and for seeing the gym_license_* fields on gyms you do not own.

Visibility: a gym is publicly listed only while is_active is true and gym_license_approved is true. A gym whose license is pending (null) or rejected (false) is hidden from everyone except its owner and admins, and it cannot sell subscriptions — see Subscribe.


Query Parameters

NameTypeRequiredDescriptionExample
city_idintNoCity ID(s) to filter by (comma-separated for multiple)"1,2,3"
state_idintNoState ID(s) to filter by (comma-separated for multiple)"4,5"
country_idintNoCountry ID(s) to filter by (comma-separated for multiple)"6"
gym_idintNoSpecific gym ID(s) to fetch (comma-separated for multiple)"10,11"
user_idintNoOwner user ID(s) to filter by (comma-separated for multiple)"42"
major_idintNoMajor ID(s) to filter by (comma-separated for multiple)"1,2"
wordstringNoSearch gyms by text"fitness"
license_statusstringNoFilter by license review state: approved, rejected, pending (comma-separated to combine). Requires gyms.view_all — silently ignored for everyone else, so the public endpoint cannot be used to probe review state."pending,rejected"
pageintNoPage number for pagination1
latfloatNoLatitude for proximity search35.6892
lngfloatNoLongitude for proximity search51.3890
radiusfloatNoRadius in kilometers for proximity search (default: 2,000,000, min: 10, max: 2,000,000)50

Results are sorted by marketing boosts first, then by proximity (if lat/lng provided), otherwise by newest.

If you specify location parameters, pagination is removed and all results within the radius are returned in one page.


Response

200 OK

Returns a paginated list of gym resources.

Schema

{
  "data": [
    { /* Gym Resource */ }
  ],
  "links": { /* Pagination Data */ },
  "meta": { /* Pagination Data */ }
}

Example

{
  "data": [
    {
      "id": 123,
      "name": "Iron Paradise",
      "address": "123 Main St",
      "location_lat": 35.6892,
      "location_lng": 51.3890,
      "is_active": true,
      "description": "A premium gym with modern equipment.",
      "created_at": "2023-01-01 10:00:00",
      "updated_at": "2023-01-01 10:00:00",
      "show_crowd": false,
      "crowd": null,
      "city": {
        "id": 5,
        "name": "Tehran",
        "state": {
          "id": 1,
          "name": "Tehran Province"
        }
      },
      "majors": [
        { "id": 1, "title": "Bodybuilding" },
        { "id": 2, "title": "Crossfit" }
      ],
      "working_periods": [],
      "working_status": null,
      "boost": null,
      "media": [],
      "rating_count": 0,
      "rating_average": 0
    }
  ],
  "links": {
    "first": "https://api.example.com/api/v1/gyms?page=1",
    "last": "https://api.example.com/api/v1/gyms?page=10",
    "prev": null,
    "next": "https://api.example.com/api/v1/gyms?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 10,
    "path": "https://api.example.com/api/v1/gyms",
    "per_page": 30,
    "to": 30,
    "total": 300
  }
}

For a full schema, see Gym Resource and Pagination Data.


Error Responses

StatusDescriptionReference
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
404Not foundNot-found error
Dambel

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutubeTelegramGitHub