Travel Advisor

FREEMIUM
Verified
Par Api Dojo | Mise à jour 2 months ago | Transportation
Popularité

9.9 / 10

Latence

2,221ms

Niveau de service

100%

Health Check

N/A

Retour à toutes les discussions

v1 works but v2 says invalid api key

Rapid account: Andrewtch 88
andrewtch88
25 days ago

V1 API

try {
    const {
      data: { data },
    } = await axios.get(
      `https://travel-advisor.p.rapidapi.com/${type}/list-by-latlng`,
      {
        params: {
          latitude: lat,
          longitude: lng,
          ...params,
        },
        headers: {
          'X-RapidAPI-Host': 'travel-advisor.p.rapidapi.com',
          'X-RapidAPI-Key': import.meta.env.VITE_TRAVEL_API_KEY,
        },
      },
      { cancelToken: source.token }
    )

V2 API

try {
    const {
      data: { data },
    } = await axios.post(
      `https://travel-advisor.p.rapidapi.com/attractions/v2/list`,
      {
        params: {
          ...params,
        },
        headers: {
          'content-type': 'application/json',
          'X-RapidAPI-Host': 'travel-advisor.p.rapidapi.com',
          'X-RapidAPI-Key': import.meta.env.VITE_TRAVEL_API_KEY,
        },
        data: {
          // geoId: geoId,
          sort: 'TRAVELER_FAVORITE_V2',
          sortOrder: 'desc',
          filters: [
            {
              id: 'category',
              value: ['42'],
            },
            {
              id: 'rating',
              value: ['40'],
            },
            {
              id: 'navbar',
              value: ['ATTRACTIONOVERVIEW:-true'],
            },
          ],
          updateToken: '',
        },
      },
      { cancelToken: source.token }
    )
Rapid account: Apidojo
apidojo Commented 25 days ago

You can test the API manually by using an HTTP client such as postman.com. I am sorry that I cannot help you with coding.

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires