Migration guide

Learn how to migrate from RapidAPI

Migration Guide: Moving from RapidAPI to new Platform

Overview

This guide outlines the necessary steps to migrate from RapidAPI to our new API platform. The migration primarily involves changes to the request URL and authentication headers. The response payload format remains unchanged, ensuring a seamless transition with no required modifications to response handling.

Changes

What Has Changed?

API Base URL Update

Old Base URL:

https://distance.p.rapidapi.com/

New Base URL:

https://api.distance.tools/api/v2/

Authentication Header Change

Old Header:

X-RapidAPI-Key: <your old RapidAPI API key>

New Header:

X-Billing-Token: <your new API key>

Host Header Removal

RapidAPI required the X-RapidAPI-Host header, but our new platform does not require this header. Simply remove it from your requests.

Migration Steps

Updating Your Requests

Old Request Format

curl -L \
  --request POST \
  --url 'https://distanceto.p.rapidapi.com/distance/route' \
  --header 'X-RapidAPI-Host: distanceto.p.rapidapi.com' \
  --header 'X-RapidAPI-Key: <your old RapidAPI API key>' \
  --header 'Content-Type: application/json' \
  --data '{"route": [{"name": "Berlin","country": "DEU"}, {"name": "Hamburg","country": "DEU"}]}'

New Request Format

curl -L \
  --request POST \
  --url 'https://api.distance.tools/api/v2/distance/route' \
  --header 'X-Billing-Token: <your new API key>' \
  --header 'Content-Type: application/json' \
  --data '{"route": [{"name": "Berlin","country": "DEU"}, {"name": "Hamburg","country": "DEU"}]}'

Additional Considerations

  • Rate Limits: Ensure that your new API key has the appropriate rate limits for your usage.

  • Testing: Before fully switching, test your integration using the new API key to confirm that requests function as expected.

  • Deprecation Timeline: If RapidAPI access is being phased out, check the deprecation schedule and transition before the cutoff date to avoid service disruptions.

Need Help?

If you have any issues during migration, refer to our API documentation or get in touch.

Last updated