# Retrieve upcoming racing competitions

## GET /competition/namecodes/

Retrieve future competition names along with event numbers, event codes, and runner details. This includes only upcoming games, which users can utilize when creating notifications or publishing tips.

### Parameters

No parameters required.

### Response

#### Success Response (200)

Returns upcoming racing competitions with detailed information:

```json
[
  {
    "code": "string",
    "name": ["string"],
    "event_number": "integer",
    "starttime": "string(date-time)",
    "runners": "string",
    "runner_names": "string",
    "country": "string",
    "scrape_date": "string(date-time)"
  }
]
```

### Response Fields

| Field          | Type           | Description                                                                                 |
| -------------- | -------------- | ------------------------------------------------------------------------------------------- |
| `code`         | string         | Code of Galloping, Harness and Greyhounds                                                   |
| `name`         | array\[string] | Venue name                                                                                  |
| `event_number` | integer        | Event number i.e., race no.                                                                 |
| `starttime`    | string         | StartTime of the event                                                                      |
| `runners`      | string         | Runners - a comma-separated list of numbers are returned as a string separated by comma     |
| `runner_names` | string         | Runner names - Name of the runners for the race are returned as a string separated by comma |
| `country`      | string         | Country                                                                                     |
| `scrape_date`  | string         | Scrape date                                                                                 |

### Example

```bash
curl -X GET "https://betmatic.app/api/competition/namecodes/" \
  -H "Authorization: Token your_token"
```

### Error Responses

* **400 Bad request** - Invalid request parameters
* **401 Invalid credentials** - Authentication token is invalid or missing

### Authentication

This endpoint requires authentication. Include your token in the Authorization header:

```
Authorization: Token your_token
```


---

# 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://betmatic.gitbook.io/documentation/api/basic-data/retrieve-upcoming-racing-competitions.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.
