Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
POST request to ProBasketballAPI.com using Javascript

I am trying to get data from the ProBasketballAPI.com API. The docs state the following:

'To make calls to the ProBasketball API, you must make a POST request to the specified URL. In this request you must pass along your API key, and that is it. You now have access to the API!

Of course you can pass along arguments other than just your API key, in fact, it is encouraged that you do so. It will help narrow down data that will be returned.

All responses will be in the JSON format.'

I am trying to pass the api_key as an argument as it states like this.

const options = {
    'api_key': JSON.stringify(api_key),
    method: 'post',
    headers: {
        'Content-Type': 'application/json'
    }
};

const x = fetch('https://probasketballapi.com/players', options);

x.then((response) => {
    const data = response.json();
    data.then((response) => {
        console.log(response)
    })
})

But I receive the following error from the api,

{ errors: [ 'The api key field is required.' ] }

I have read the documentation but I can not figure it out. The documentation can be found at https://probasketballapi.com/docs/authentication

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda