GeoDB Cities

FREEMIUM
Verified
✓
Par Michael Mogley | Mise à jour 22 giorni fa | Data
Popularité

9.9 / 10

Latence

54ms

Niveau de service

100%

Health Check

100%

Retour à toutes les discussions

Expected format for axios.get - Fixed

Rapid account: Michelehobson
michelehobson
6 mesi fa

Hi,

I am doing a project for school and one of the requirements is that I use the axios.get method.
I’ve tried a variety of combinations, but it keeps returning 401 unauthorized.

I’ve tried:
const countries = await axios.get(https://wft-geo-db.p.rapidapi.com/v1/geo/countries?X-RapidAPI-Key=${key}?X-RapidAPI-Host=${host});

key and host both work when I use the code supplied by GeoDb.
Does anyone know how the string should be formatted? Also, when using the GeoDb code it only returned five countries. Any idea why?
Thank you

Rapid account: Wirefreethought
wirefreethought Commented 6 mesi fa

I believe the default page-size limit imposted by the GeoDB client is 5. You are getting the first page of country results. To see the next, set the offset appropriately. You can increase the limit to 10 on the Basic plan.

Rapid account: Wirefreethought
wirefreethought Commented 6 mesi fa

The key and host params are request headers. They should NOT appear in the query string. You need to submit them as headers in the axios.get call.

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

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