Introduction
Here you can find the documentation about Octagon API. This API is designed to provide data about professional fighters categorized across various weight divisions in MMA.
This documentation will guide you through the available endpoints, parameters, and response formats to help you integrate this data into your applications or services.
If you have any questions, encounter issues, or need further assistance, feel free to open an issue on GitHub or reach out to me at fentos.dev@gmail.com.
In this table, you will find a summary of the endpoints.
Endpoint | Response |
---|---|
GET /rankings | Returns whole rankings info. |
GET /fighters | Returns all fighters info. |
GET /fighter/:fighterId | Returns single fighter info. |
GET /division/:divisionId | Returns single division info. |
GET /rankings
This endpoint returns the whole rankings data.
The JSON data is an array, where each entry is an object with the properties listed in the table.
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the category. |
categoryName | string | Name of the ranking category. |
champion | object | Information about the champion of the category. Includes id and championName . |
champion.id | string | Unique identifier of the champion. |
champion.championName | string | Name of the champion. |
fighters | array | List of fighters in the category. Includes id and name . |
fighters[].id | string | Unique identifier of the fighter. |
fighters[].name | string | Name of the fighter. |
GET /fighters
This endpoint returns the whole fighters data.
The JSON data is an Object, where each key
is the unique identifier of a fighter.
The value
is an object containing various details about the fighter. The properties of each fighter object are listed in the table, providing information such as the fighter’s division, record, personal details, and physical attributes.
Field | Type | Description |
---|---|---|
category | string | Division or category of the fighter. |
draws | string | Number of draws in the fighter’s career. |
imgUrl | string | URL to the fighter’s image. |
losses | string | Number of losses in the fighter’s career. |
name | string | Full name of the fighter. |
nickname | string | Nickname of the fighter. |
wins | string | Number of wins in the fighter’s career. |
status | string | Current status of the fighter (e.g., Active, Retired). |
placeOfBirth | string | Place where the fighter was born. |
trainsAt | string | Training facility where the fighter trains. |
fightingStyle | string | Fighting style of the fighter. |
age | string | Age of the fighter. |
height | string | Height of the fighter (in inches). |
weight | string | Weight of the fighter (in pounds). |
octagonDebut | string | Date of the fighter’s debut in the octagon. |
reach | string | Reach of the fighter (in inches). |
legReach | string | Leg reach of the fighter (in inches). |
GET /fighter/:fighterId
This endpoint returns the concrete fighterId
data.
The JSON data is an Object containing various details about the fighter. These properties are listed in the table, providing information such as the fighter’s division, record, personal details, and physical attributes.
Field | Type | Description |
---|---|---|
category | string | Division or category of the fighter. |
draws | string | Number of draws in the fighter’s career. |
imgUrl | string | URL to the fighter’s image. |
losses | string | Number of losses in the fighter’s career. |
name | string | Full name of the fighter. |
nickname | string | Nickname of the fighter. |
wins | string | Number of wins in the fighter’s career. |
status | string | Current status of the fighter (e.g., Active, Retired). |
placeOfBirth | string | Place where the fighter was born. |
trainsAt | string | Training facility where the fighter trains. |
fightingStyle | string | Fighting style of the fighter. |
age | string | Age of the fighter. |
height | string | Height of the fighter (in inches). |
weight | string | Weight of the fighter (in pounds). |
octagonDebut | string | Date of the fighter’s debut in the octagon. |
reach | string | Reach of the fighter (in inches). |
legReach | string | Leg reach of the fighter (in inches). |
GET /division/:divisionId
This endpoint returns the concrete divisionId
data.
The JSON data is an Object that represents a division of fighters, containing properties such as the category ID, category name, champion details, and an array of fighters with their respective IDs and names, as outlined in the table.
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the category. |
categoryName | string | Name of the ranking category. |
champion | object | Information about the champion of the category. Includes id and championName . |
champion.id | string | Unique identifier of the champion. |
champion.championName | string | Name of the champion. |
fighters | array | List of fighters in the category. Includes id and name . |
fighters[].id | string | Unique identifier of the fighter. |
fighters[].name | string | Name of the fighter. |
GraphQL API
In addition to our REST endpoints, we offer a GraphQL API for more flexible and efficient data querying. GraphQL allows you to request exactly the data you need in a single query, reducing over-fetching and under-fetching of data.
GraphQL Endpoint
Schema Overview
Our GraphQL schema includes the following main types:
Query
: The entry point for all GraphQL queriesDivision
: Represents a weight divisionFighter
: Represents a fighterChampion
: Represents a champion of a division
Example Queries
- Get all rankings with champions and fighters:
- Get detailed information about a specific fighter:
- Get information about a specific division:
Using GraphQL in Your Application
To use our GraphQL API:
- Send a POST request to
https://api.octagon-api.com/graphql
- Set the
Content-Type
header toapplication/json
- In the request body, include a JSON object with a
query
key containing your GraphQL query
Example using curl:
Benefits of Using GraphQL
- Flexible Queries: Request multiple resources in a single query
- Precise Data Fetching: Get only the data you need, nothing more, nothing less
- Strongly Typed: The schema provides clear expectations about the structure of the data
- Introspection: Explore the available data and schema using GraphQL introspection
GraphQL Playground
For interactive exploration of our GraphQL API, you can use the GraphQL Playground available at:
This web-based tool allows you to write and execute queries, explore the schema, and view documentation.
For more information on how to use GraphQL, please refer to the official GraphQL documentation.