Travel Advisor

免费增值
Verified
通过 Api Dojo | 已更新 2달 전 | Transportation
人气

9.9 / 10

延迟

2,166ms

服务等级

100%

Health Check

N/A

返回所有讨论

v1 works but v2 says invalid api key

Rapid account: Andrewtch 88
andrewtch88
한 달 전

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 한 달 전

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.

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论