# Migration Guide - V1 to V2 API
URL: https://sportsgameodds.com/docs/info/v1-to-v2

Migration Guide - V1 to V2 API [#migration-guide---v1-to-v2-api]

Overview of Changes [#overview-of-changes]

* **Odds can update significantly more frequently** - We overhauled our system which aggregates and syncs odds data to the API, allowing us to significantly speed up the polling frequency of odds data and offer data at less than 50% the delay of the previous system. Effects on your data depend on tier.
* **Faster API Response Times** - When fetching data from the API, you should receive data significantly faster. This change affects both v1 and v2 endpoints. Note that v2 responses often contain more data than v2 which may affect response times.
* **Combined /odds and /events endpoints** - You no longer need to query one endpoint to get odds breakdowns by sportsbook and another endpoint to get event metadata (status, teams, players, results, etc.). All of this data has now been combined into a single `/v2/events` endpoint.
* **Added deeplinks to odds data** - We've added a deeplink field to the bookmaker-specific odds data. Only major US sportsbooks were included at launch (FanDuel, Draftkings, BetMGM) with more to come soon after.
* **Bookmaker-specific odds persist when unavailable/inactive** - Previously, odds for a specific bookmaker (under the byBookmaker field) would only show when those odds were actively being offered (open for wagers) by that bookmaker and would disappear when no longer offered. In v2, all odds (both for main lines and alt lines) will show along with an `available` field which tells you whether those odds are actively being offered (open for wagers).
* **Improved Player System** - Players are now unique across all teams in a league. This means a player will have the same playerID regardless of which team they are on. This new player system also allows us to return a higher number of player props odds and results/stats data when querying Events.
* **More request options added to Events (/Odds) endpoint** We added 10 additional parameters to the /events endpoint to help you zero-in on the data you need. Even more options are coming soon.

Upgrade Guide [#upgrade-guide]

v2 playerID -> v1 playerID [#v2-playerid---v1-playerid]

Here we recommend calling the v2/players endpoint providing the v2 playerID as the playerID param and then finding the v1 playerID you're looking for in the response's aliases field

New Features & Non-Breaking Changes [#new-features--non-breaking-changes]

The API key can now be included in the URL query params [#the-api-key-can-now-be-included-in-the-url-query-params]

You no longer have to include your API key in the headers. You can also include it in the request query params instead.
`https://api.sportsgameodds.com/v2/events?apiKey=YOUR_API_KEY_CAN_GO_HERE`

New params for v2/events endpoint [#new-params-for-v2events-endpoint]

* `type` - Only include Events of the specified type which can be `match`, `prop`, or `tournament`
* `oddsPresent` - Whether you want only Events which do (true) or do not (false) have any associated odds markets regardless of whether those odds markets are currently available (open for wagering)
* `includeOpposingOdds` - Whether to include opposing odds for each included oddID. This was renamed from `includeOpposingOddIDs` in v1 but the old name will still work.
* `includeAltLines` - Whether to include alternate lines in the odds byBookmaker data
* `bookmakerID` - A bookmakerID or comma-separated list of bookmakerIDs to include odds for
* `teamID` - A teamID or comma-separated list of teamIDs to include Events (and associated odds) for
* `playerID` - A single playerID or comma-separated list of playerIDs to include Events (and associated odds) for
* `live` - Only include live Events (true), only non-live Events (false) or all Events (omit)
* `started` - Only include Events which have have previously started (true), only Events which have not previously started (false) or all Events (omit)
* `ended` - Only include Events which have have ended (true), only Events which have not ended (false) or all Events (omit)
* `cancelled` - Only include cancelled Events (true), only non-cancelled Events (false) or all Events (omit)
* `includeOpenCloseOdds` - Whether to include open and close odds values (openOdds, closeOdds, openSpread, closeSpread, openOverUnder, closeOverUnder) in the odds byBookmaker data. Defaults to false.

New deeplink fields [#new-deeplink-fields]

You'll be able to find deeplink information on a per-bookmaker basis at the following path on Event objects:
`Event.odds.<oddID>.byBookmaker.<bookmakerID>.deeplink`
Deeplinks will also appear on altLines but only if they are different from the deeplink value on the main line
`Event.odds.<oddID>.byBookmaker.<bookmakerID>.altLines.[i].deeplink`

Market name field added to odds [#market-name-field-added-to-odds]

Odds items now contain a human-readable `marketName` field.

Standardized weight, height and salary fields [#standardized-weight-height-and-salary-fields]

These should now return a more consistent string-based value including units.

Added nickname and suffix to player names [#added-nickname-and-suffix-to-player-names]

These fields will show only when applicable

Renamed Parameters with Backwards Compatibility [#renamed-parameters-with-backwards-compatibility]

Certain API request options/parameters have been renamed. However all of the previous names will still work. For example, we've renamed `includeOpposingOddIDs` to `includeOpposingOdds` but the old param will also still work

Per-request default and max limits have changed [#per-request-default-and-max-limits-have-changed]

* For /events
  * default limit: 30 -> 10
  * max limit: 300 -> 100
* For teams and players
  * default limit: 30 -> 50
  * max limit: 300 -> 250