# Migrate from another SERP API

The /v1/serp and /api/v1/search endpoints accept the standard SERP API parameters and return the standard shapes: switch the base URL and key.

## Overview

If you already call a SERP API's `google_hotels`, `google_hotels_property`, `airbnb` or `airbnb_property_availability_calendar` engines, the compatible endpoints accept the same parameter names and return the same response hierarchy, so your parsing code keeps working. The Google Flights endpoints follow SerpApi's Google Flights flow (`departure_token`, `booking_token`), with their own parameter names. What changes is the host, the key and — for everything except the Airbnb GET alias — the HTTP method: these endpoints take a JSON body.

> **Why switch**
>
> [POST /v1/serp/google_hotels_calendar](https://scrapercompany.com/docs/reference/serp-google-hotels-calendar) returns a whole forward horizon (up to 330 nights) in one 5-credit call, where a per-date SERP API needs one request per night. Failed requests are free.

## Endpoint mapping

| Standard SERP API | ScraperCompany | Compatibility |
| --- | --- | --- |
| `GET /api/v1/search?engine=airbnb` | [GET /api/v1/search?engine=airbnb](https://scrapercompany.com/docs/reference/airbnb-search-get) | Drop-in: same path, query parameters and response. Also available as POST /v1/serp/airbnb with a JSON body. |
| `engine=google_hotels` | [POST /v1/serp/google_hotels](https://scrapercompany.com/docs/reference/serp-google-hotels) | Same request names (q, check_in_date, check_out_date, filters, next_page_token) and response hierarchy. Filters this source can't honour (brands, rentals only, bounding box, bedrooms, bathrooms) are refused with 422 instead of ignored. |
| `engine=google_hotels_property` | [POST /v1/serp/google_hotels_property](https://scrapercompany.com/docs/reference/serp-google-hotels-property) | Same parameter names and response shape, sent as a JSON body. |
| No equivalent (one request per date) | [POST /v1/serp/google_hotels_calendar](https://scrapercompany.com/docs/reference/serp-google-hotels-calendar) | The standard parameter style and price fields, for a whole horizon. |
| `engine=airbnb_property_availability_calendar` | [POST /v1/serp/airbnb_property_availability_calendar](https://scrapercompany.com/docs/reference/serp-airbnb-calendar) | Field for field (property_id, start_month, start_year, months, airbnb_domain). Optionally adds Airbnb's quoted prices with price_nights. |
| `engine=google_flights` | [POST /v1/serp/google_flights](https://scrapercompany.com/docs/reference/google-flights) | Same filters under mostly the same names (SerpApi style); departure, arrival and departure_date instead of departure_id, arrival_id and outbound_date. See the table below. |
| SerpApi `departure_token` follow-up | [POST /v1/serp/google_flights_return](https://scrapercompany.com/docs/reference/google-flights-return) | Return or next multi-city leg for a chosen itinerary. |
| SerpApi `booking_token` follow-up | [POST /v1/serp/google_flights_booking](https://scrapercompany.com/docs/reference/google-flights-booking) | booking_options[] with sellers, prices, fare rules, bag fees and links. |
| `engine=google_flights_location_search` | [POST /v1/serp/google_flights_location_search](https://scrapercompany.com/docs/reference/google-flights-locations) | Airports, cities (with their airports) and regions for a name. |
| `engine=google_flights_calendar` | [POST /v1/serp/google_flights_calendar](https://scrapercompany.com/docs/reference/google-flights-calendar) | Similar data, different parameter names and response. |

## Switch your client

### Airbnb: change the host and key

```bash
# Before: <your SERP API host>/api/v1/search?engine=airbnb&q=Toronto&api_key=...
curl "https://api.scrapercompany.com/api/v1/search?engine=airbnb&q=Toronto&check_in_date=2027-01-18&check_out_date=2027-01-20&adults=2" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY"
```

### Google Hotels property: same parameters, JSON body

```bash
# Before: GET <your SERP API host>/api/v1/search?engine=google_hotels_property&property_token=...&check_in_date=...
curl -X POST "https://api.scrapercompany.com/v1/serp/google_hotels_property" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"property_token": "ChUIoben2Mv6-CYaCi9tLzA3czVwbjQQAQ", "check_in_date": "2027-01-18", "check_out_date": "2027-01-19", "adults": 2, "currency": "USD", "gl": "us"}'
```

### Replace per-date loops with the calendar

```bash
curl -X POST "https://api.scrapercompany.com/v1/serp/google_hotels_calendar" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"property_token": "ChUIoben2Mv6-CYaCi9tLzA3czVwbjQQAQ", "days": 90, "currency": "USD", "gl": "us"}'
```

### Google Flights: rename a few fields

| Standard SERP API / SerpApi | ScraperCompany |
| --- | --- |
| `departure_id, arrival_id` | `departure` / `arrival` (one IATA airport or city code), or `departure_id` / `arrival_id` for lists and `/m/` city ids |
| `outbound_date, return_date` | `departure_date`, `return_date` |
| `type, multi_city_json` | Implied by `return_date` or `multi_city` |
| `travel_class` | `cabin_class` (economy, premium_economy, business, first) |
| `bags` | `carry_on_bags`, `checked_bags` |
| `exclude_basic, emissions, exclude_conns` | `exclude_basic_economy`, `less_emissions`, `exclude_connecting_airports` |
| `stops` | `stops` as the maximum number of stops (0 nonstop, 1 or 2); omit for any |
| `include_airlines, exclude_airlines, max_price, max_duration, outbound_times, return_times, layover_duration, sort_by` | Same names (sort_by as words: top_flights, price, departure_time, arrival_time, duration, emissions) |
| `best_flights / other_flights` | `itineraries[]` with `group`: best or other |
| `flights[], layovers[], total_duration` | `legs[].segments[]`, `legs[].layovers[]`, `total_duration_minutes` |
| `booking_options[].together` | `booking_options[]` |

`departure_token` and `booking_token` keep SerpApi's meaning: an itinerary with more legs to choose carries a `departure_token` for [POST /v1/serp/google_flights_return](https://scrapercompany.com/docs/reference/google-flights-return), and a complete one carries a `booking_token` for [POST /v1/serp/google_flights_booking](https://scrapercompany.com/docs/reference/google-flights-booking). The full flow is in [Price a round trip](https://scrapercompany.com/docs/guides/round-trip-flights).

> **Upgrading an existing ScraperCompany flights integration**
>
> `booking_token` used to hold Google's raw price token on every itinerary. It now appears only on complete itineraries and is what the booking endpoint takes; the raw token is in `price_token`. If you used `booking_token` as an itinerary key, switch to `price_token`.

## Differences to know

- **Method.** Only the Airbnb engine has a GET query-string alias. The Google Hotels and Google Flights endpoints are POST with a JSON body.
- **Auth.** Use the `x-api-key` header; `api_key` as a query parameter also works on GET. Unknown body fields are rejected with `422`, so drop `api_key` from JSON bodies, and `engine` too except on `/v1/serp/google_hotels` and `/v1/serp/airbnb_property_availability_calendar`, which accept it as other SERP APIs send it.
- **Tokens.** `property_token` is required. If you don't have one, resolve it with [POST /v1/search](https://scrapercompany.com/docs/guides/find-property-token).
- **Prices.** `extracted_price` values are exact floats rather than rounded integers, and are always filled in.
- **Flights.** A few parameter and response names differ from SerpApi's Google Flights engine ([table above](#switch-flights)). Times are airport-local without a UTC offset, as in SerpApi's.
- **Destination search.** `google_hotels` results keep exact float prices and add `prices[]` where Google attached seller rows. Pages overlap by a few records, so de-duplicate by `property_token`.
- **Billing.** You pay credits per successful call (3 per destination-search page, 3 for property, 5 for a calendar, 8 for Airbnb search or availability calendar, 3 per flight search, return leg or booking options), not per search, and failures are free. See [Credits & billing](https://scrapercompany.com/docs/credits).

Source: https://scrapercompany.com/docs/guides/serp-api-migration
