Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!