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

243
Views
Cross-Origin Request Blocked Error in Javascript (Axios)

I'm using an api for fantasy football data, specifically in this example from the following URL: https://fantasy.premierleague.com/api/entry/1225457/

When I try to send a GET request using axios in javascript (React) like so:

export function AgentCard(){
    const [agentInfo,setAgentInfo] = useState({});

    useEffect(()=> {
        console.log('running useEffect')
        axios.get('https://fantasy.premierleague.com/api/entry/1225457/').then(res=>{
            console.log(res);
        })
    },[])


    return(
        <div>
            <h1>Test</h1>
        </div>
    )


    
}

I get the following error in the browser console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://fantasy.premierleague.com/api/entry/1225457/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200

But when I try to access the endpoint from a browser (Mozilla), it displays the contents

I know there's something up with the API because my code works for other APIs

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!