# Migration from Demand API V2 Guide

This page summarizes the main differences in architecture, design, and functionality between the Demand API V2 and the Connect API.
Read this topic to help plan your migration.

## Authentication

In Connect API, each call to endpoints must identify an API user that is authorised to access that
endpoint ([Identify the API user in a request](/metasearch/connect-api/development-guide/authentication#identify-the-api-user-in-a-request))

To enable an API user to access the Connect API, you must do the following:

* Authenticate the API key to get an access token
* Include your access token and the appropriate account id in the header of every request.


The API key is an HTTP [bearer token](https://www.rfc-editor.org/info/rfc6750). Bearer tokens provide greater security
than the Basic authentication method used in Demand API V2.

For more information, see [Authentication and authorization](/demand/docs/development-guide/authentication).

## Endpoint structure

The following table compares the structure of Demand API V2 and Connect API endpoints.

|  | Demand API V2 | Connect API Demand API V2 Compatible |
|  --- | --- | --- |
| **Protocol** | `https` | `https` |
| **Base URL - production** | `distribution-xml.booking.com/2.*/` | `metasearch-connect-api.booking.com/demand-api-v2-compatible/` |
| **Authentication** | Basic Authentication | Bearer Token |


### An example mapping

#### Demand API V2


```bash
GET https://distribution-xml.booking.com/2.10/hotelAvailability?
     city_ids=-2140479
     &guest_country="nl"
     &room1="A,A"
     &checkin="2023-08-15"
     &checkout="2023-08-16"
```

#### Connect API


```bash
GET https://metasearch-connect-api.booking.com/demand-api-v2-compatible/hotelAvailability?
     city_ids=-2140479
     &guest_country="nl"
     &room1="A,A"
     &checkin="2023-08-15"
     &checkout="2023-08-16"
```

##### Accept Header

Provide a valid Accept header value based on API documentation. See [Demand API V2 compatible endpoints](/metasearch/connect-api/open-api/demand-api-v2-compatible)
and [Demand API V3 compatible endpoints](/metasearch/connect-api/open-api/demand-api-v3-compatible) for more information.

## Errors

The page [Error handling](/metasearch/connect-api/development-guide/error-handling) describes what errors can occur when calling Connect
API endpoints and what you should do to avoid or fix them. You should update your error handling code in line with the
guidance and information given there.