> For the complete documentation index, see [llms.txt](https://developer.aiodds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.aiodds.com/operation/faq.md).

# FAQ

## Questions about 'Time'

**Q: Does the timer in match trigger a push every second?**

A:&#x20;

No. Changes in time do not trigger a push. Only other data changes will trigger updates. After receiving a time value, you need to handle the timer locally, and overwrite it with the next received value to recalculate.

***

**Q: How to calculate duration based on a timer?**

A:&#x20;

* When the first digit `clockrunning = 1`, go through the following steps:

1. When the second digit `countdown = 1`, directly take the fourth digit.
2. When the second digit `countdown = 0` and the third digit `update time = 0`, directly take the fourth digit.
3. When the second digit `countdown = 0` and the third digit update time exists, use this formula:

```
current time - update time + fourth digit
```

* When the first digit `clockrunning = 0`, directly take the fourth digit.

For example, if it is halftime in football, `clockrunning` will be `0` and the fourth digit will also be `0`.

***

**Q: How to determine match status and match time?**

A:&#x20;

Match status such as set or half can be retrieved from the `period` field.

If match time data is available, you can calculate it according to the steps in the next question.

***

**Q: How to calculate match time?**

A:&#x20;

In '[Search matches](/bookmaker-odds/basic-data/match.md#get-v1-match-list)' API, use the `timer` field.

The data is unified into a four-digit integer format:

1. The first digit determines whether the clock is running. If it is `0`, the clock is not running.
2. The second digit represents whether time counts down. For example, if it is `1`, in basketball it means time decreases in each quarter, while in football time increases.
3. The third digit represents the timestamp of the moment when the data was generated. It is used to calculate the time offset between the client and the server. If it is `0`, it can be ignored.
4. The fourth digit represents the game time.

Calculation formula:

```
if third digit > 0:
  current timestamp - third digit + fourth digit
else:
  fourth digit
```

{% hint style="warning" %}
All time data is based on seconds. Divide by `60` to get minutes.
{% endhint %}

***

## Questions about 'Line'

**Q: What does 'line' represent?**

A:&#x20;

The line field contains the betting line value for an outcome and is returned as a string. Its meaning depends on the market type.

***

**Q: How should positive and negative line values be interpreted for handicap markets?**

A:

For handicap markets, the line indicates the handicap value.&#x20;

In AiOdds, the sign of the line is interpreted from the home team's perspective:

* A negative line means the home team gives the handicap.
* A positive line means the home team receives the handicap.

For example, a line of `-1.5` means the home team must win by at least two goals for the home selection to win. The corresponding away line is `+1.5.`

***

**Q: How should 'line' be interpreted for Under/Over markets?**

A:&#x20;

For Under/Over markets, the line indicates the total threshold.

For example, a line of `3` means:

* Under wins if the total is less than 3.
* Over wins if the total is greater than 3.
* The result is a push if the total is exactly 3.

***

**Q: What does main\_line mean?**

A:&#x20;

The main\_line field identifies the main betting line within a market.

Compare main\_line with the line value of each outcome:

* If an outcome's line matches main\_line, the outcome is offered on the main line.
* Other line values are alternate lines.

For example, if main\_line is `-2.5`, the outcome with line `-2.5` is offered on the main line, while `-1.5` and `-3.5` are alternate lines.

***

## Questions about 'WebSocket'

**Q: Can multiple WebSocket connections be established?**

A:&#x20;

Yes, multiple connections are allowed. However, they will receive the same data, so you need to handle routing yourself.

{% hint style="warning" %}
Each connection must use a different `client_id`.
{% endhint %}

***

**Q: How many WebSocket connections can be made?**

A:

Each customer can create up to 20 WebSocket connections.

If only one of your IPs can connect to WebSocket, check whether you have already reached the 20-connection limit.

***

**Q: What does hide mean in WebSocket data?**

A:&#x20;

If `hide` is `1`, it means the match is invalid or abnormal. Clients can choose not to display such matches on the frontend.

***

**Q: Does 'update' changes mean the odds in outcomes changes?**

A:

Usually, yes.

{% hint style="warning" %}
However, there may be a special case that odds has no change but uptime has changed. Generally, we will perform filtering. You can overwrite duplicate odds data. This does not affect usage.
{% endhint %}

***

**Q: How will WebSocket return odds for ended first half?**

A:

We will provide `lost` field with `1` for ended first half match. You can choose to hide odds with lost provided 1.

***

**Q: What is the meaning of 'string score' and 'int32 line\_score'?**

A:

* `string score` stands for Handicap score.
* `int32 line_score` stands for whether this match has Handicap score.

{% hint style="warning" %}
However, currently we don't have data for these two fields. Once we have data in the near future, we will also provide them in the API.
{% endhint %}

***

**Q: What is the meaning of 'change' and 'lost'?**

A:

* `change` indicates whether the odds value increased or decreased.
* `lost` indicates whether the outcome is unavailable. The default is 0. If this field does not return, it means 0.

***

**Q: How to recover the lost data during the period of WebSocket disconnection?**

A:

You can use 'Snapshot' to recover the data.

***

**Q: Will WebSocket automatically recover the lost data once reconnected?**

A:

No. WebSocket only returns current live data and cannot recover historical data.

***

## Questions about 'Settlement'

**Q: What does void\_factor mean?**

A:&#x20;

The void\_factor field indicates whether the settlement result applies in full or in half. It must be interpreted together with the result field.

* 0 means Full.
* 0.5 means Half.

The result field determines whether the outcome is Won, Lost, or Refunded, while void\_factor determines whether that result is full or half.

For example:

* result = 1 and void\_factor = 0 means Won.
* result = 1 and void\_factor = 0.5 means Half Won.
* result = 2 and void\_factor = 0.5 means Half Lost.
* result = 4 and void\_factor = 0 means Refunded.

***

**Q: Is outcomeid unique?**

A:&#x20;

No. `outcomeid` is determined by the combination of `name` and `line`, and is not related to the bookmaker.

***

**Q: How to determine if a market is closed?**

A:&#x20;

Check the lost field for all outcomes within the market.

A market is considered closed when all of its outcomes have lost set to `1`. If only some outcomes have lost set to `1`, only those outcomes have been removed; the market itself is not considered closed.

***

**Q: What is the difference between 'Suspended' and 'Lost'?**

A:

Suspended means that an outcome is temporarily unavailable for betting. It remains in the odds feed and may become available again.

When lost is set to 1, that outcome has been closed and removed from the odds feed. The lost field indicates removal and is unrelated to the settlement result lost.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.aiodds.com/operation/faq.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
