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

247
Views
Riot API: I don't know why it returns unauthorized (401)

I don't know why this would be unauthorized. I checked that the api_key and puuid are correct. When I made a request to another Riot API in a similar way, I got the desired result (status code: 200). I'm guessing there is a typo in the URL that sent the request, but I can't find where it went wrong.

import fetch from 'node-fetch'

const getMatchList = async () => {
  const puuid = 'XXXXXXXX'
  const api_key = 'XXXXXXX'
  const res = await fetch(
    `https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/${puuid}/ids?start=0&count=1?api_key=${api_key}`
  )
  const myJson = await res.json()
  console.log(myJson) // { status: { message: 'Unauthorized', status_code: 401 } }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Change the '?' in the api_key for '&' just like that: Original: https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/${puuid}/ids?start=0&count=1?api_key=${api_key}

Right: https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/${puuid}/ids?start=0&count=1&api_key=${api_key}

about 4 years ago · Juan Pablo Isaza Report
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!