# Example Usage

## Get Script Details

### 1️. Get Script Details (Basic)

Returns public information about a specific script.

```http
GET /api/v1/public/scripts/tgiann-inventory
Content-Type: application/json
```

**Description:**\
Retrieves public details of the script identified by `tgiann-inventory`.

***

### 2️. Get Script Details with Server IDs

Includes the list of server IDs that are currently using this script.

```http
GET /api/v1/public/scripts/tgiann-inventory?getServerIds=true
Content-Type: application/json
```

**Description:**\
Returns script details along with the server IDs using this script.

***

### 3. cURL Example

```bash
curl -X GET "https://fivemstats.net/api/v1/public/scripts/tgiann-inventory?getServerIds=false" \
  -H "Content-Type: application/json"
```

***

### 4. JavaScript (Fetch) Example

```js
fetch("https://fivemstats.net/api/v1/public/scripts/tgiann-inventory?getServerIds=false", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
  },
})
  .then((res) => res.json())
  .then((data) => console.log(data));
```

***

### 5. Axios Example

```js
import axios from "axios";

const response = await axios.get(
  "https://fivemstats.net/api/v1/public/scripts/tgiann-inventory",
  {
    params: {
      getServerIds: false,
    },
    headers: {
      "Content-Type": "application/json",
    },
  }
);

console.log(response.data);
```

***

## Get Server Details

### 1. Get Server Details (Basic)

Returns public details of a single server.

```
GET /api/v1/public/servers/byejz8
Content-Type: application/json
```

**Description:**\
Retrieves public details of the server identified by `byejz8`.

***

### 2. cURL Example

```bash
curl -X GET "https://fivemstats.net/api/v1/public/servers/byejz8" \
  -H "Content-Type: application/json"
```

***

### 3. JavaScript (Fetch) Example

```js
fetch("https://fivemstats.net/api/v1/public/servers/byejz8", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
  },
})
  .then((res) => res.json())
  .then((data) => console.log(data));
```

***

### 4. Axios Example

```js
import axios from "axios";

const response = await axios.get(
  "https://fivemstats.net/api/v1/public/servers/byejz8",
  {
    headers: {
      "Content-Type": "application/json",
    },
  }
);

console.log(response.data);
```

***

## Get Server Player History

### 1. Get Server Player History (Basic)

Returns player count history for the last 7 days.

```
GET /api/v1/public/servers/byejz8/history
Content-Type: application/json
```

**Description:**\
Retrieves the last 7 days of recorded player count history for the server identified by `byejz8`.

***

### 2. cURL Example

```bash
curl -X GET "https://fivemstats.net/api/v1/public/servers/byejz8/history" \
  -H "Content-Type: application/json"
```

***

### 3. JavaScript (Fetch) Example

```js
fetch("https://fivemstats.net/api/v1/public/servers/byejz8/history", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
  },
})
  .then((res) => res.json())
  .then((data) => console.log(data));
```

***

### 4. Axios Example

```js
import axios from "axios";

const response = await axios.get(
  "https://fivemstats.net/api/v1/public/servers/byejz8/history",
  {
    headers: {
      "Content-Type": "application/json",
    },
  }
);

console.log(response.data);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fivemstats.net/api/example-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
