Discuss Scratch

BwnnyRxbbit
Scratcher
100+ posts

Scratch API error handling

[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));

Last edited by BwnnyRxbbit (April 24, 2024 07:56:54)



Meow
dynamicsofscratch
Scratcher
1000+ posts

Scratch API error handling

BwnnyRxbbit wrote:

(#1)
[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));

you're not allowed to access the api because of access control checks.
try disabling cors

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
BwnnyRxbbit
Scratcher
100+ posts

Scratch API error handling

dynamicsofscratch wrote:

BwnnyRxbbit wrote:

(#1)
[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));

you're not allowed to access the api because of access control checks.
try disabling cors
Can you do this in code?

Last edited by BwnnyRxbbit (April 24, 2024 21:21:41)



Meow
ajskateboarder
Scratcher
1000+ posts

Scratch API error handling

BwnnyRxbbit wrote:

[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));
You cannot get past this error without using a proxy to bypass CORS restrictions. TurboWarp provides a proxy that lets you get limited information from the API, including user data:
fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit")
    .then((response) => response.json())
    .then((response) => {
        // do whatever with the response
    })
BwnnyRxbbit
Scratcher
100+ posts

Scratch API error handling

ajskateboarder wrote:

BwnnyRxbbit wrote:

[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));
You cannot get past this error without using a proxy to bypass CORS restrictions. TurboWarp provides a proxy that lets you get limited information from the API, including user data:
fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit")
    .then((response) => response.json())
    .then((response) => {
        // do whatever with the response
    })
Thank you so much for your help!


Meow
BwnnyRxbbit
Scratcher
100+ posts

Scratch API error handling

ajskateboarder wrote:

BwnnyRxbbit wrote:

[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));
You cannot get past this error without using a proxy to bypass CORS restrictions. TurboWarp provides a proxy that lets you get limited information from the API, including user data:
fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit")
    .then((response) => response.json())
    .then((response) => {
        // do whatever with the response
    })
Is there a way to do this with studios and projects?


Meow
dynamicsofscratch
Scratcher
1000+ posts

Scratch API error handling

BwnnyRxbbit wrote:

(#6)

ajskateboarder wrote:

BwnnyRxbbit wrote:

[Error] Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Fetch API cannot load https://api.scratch.mit.edu/users/BwnnyRxbbit/ due to access control checks.
[Error] Failed to load resource: Origin http://127.0.0.1:5500 is not allowed by Access-Control-Allow-Origin. Status code: 200 (BwnnyRxbbit, line 0)
[Error] Unhandled Promise Rejection: TypeError: Load failed

Is there a way to get past this error?
code (copied from the internet):
fetch("https://api.scratch.mit.edu/users/BwnnyRxbbit/")
  .then((response) => response.json())
  .then((json) => console.log(json));
You cannot get past this error without using a proxy to bypass CORS restrictions. TurboWarp provides a proxy that lets you get limited information from the API, including user data:
fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit")
    .then((response) => response.json())
    .then((response) => {
        // do whatever with the response
    })
Is there a way to do this with studios and projects?
it'd the same but use studios and projects

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
BwnnyRxbbit
Scratcher
100+ posts

Scratch API error handling

It works for projects but not for studios.


Meow
dynamicsofscratch
Scratcher
1000+ posts

Scratch API error handling

BwnnyRxbbit wrote:

(#8)
It works for projects but not for studios.
hmm. must be limited (as mentioned by ajskateboarder)
a new scratch api proxy needed…

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
ninjaMAR
Scratcher
1000+ posts

Scratch API error handling

dynamicsofscratch wrote:

(#9)

BwnnyRxbbit wrote:

(#8)
It works for projects but not for studios.
hmm. must be limited (as mentioned by ajskateboarder)
a new scratch api proxy needed…
You can use any generic CORS proxy
https://github.com/Rob–W/cors-anywhere
dynamicsofscratch
Scratcher
1000+ posts

Scratch API error handling

ninjaMAR wrote:

(#10)

dynamicsofscratch wrote:

(#9)

BwnnyRxbbit wrote:

(#8)
It works for projects but not for studios.
hmm. must be limited (as mentioned by ajskateboarder)
a new scratch api proxy needed…
You can use any generic CORS proxy
https://github.com/Rob–W/cors-anywhere

he's tryna use the turbowarp one

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post

Powered by DjangoBB