Travel Advisor

부분 유료
Verified
분류별 Api Dojo | 업데이트됨 2ヶ月前 | Transportation
인기

9.9 / 10

지연 시간

2,221ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

v1 works but v2 says invalid api key

Rapid account: Andrewtch 88
andrewtch88
25日前

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日前

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.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입