Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Scratch API error handling
- 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
(#1)you're not allowed to access the api because of access control checks.[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));
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.
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
Can you do this in code?(#1)you're not allowed to access the api because of access control checks.[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));
try disabling cors
Last edited by BwnnyRxbbit (April 24, 2024 21:21:41)
Meow
- ajskateboarder
- Scratcher
1000+ posts
Scratch API error handling
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:[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));
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
Thank you so much for your help!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:[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));fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit") .then((response) => response.json()) .then((response) => { // do whatever with the response })
Meow
- BwnnyRxbbit
- Scratcher
100+ posts
Scratch API error handling
Is there a way to do this with studios and projects?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:[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));fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit") .then((response) => response.json()) .then((response) => { // do whatever with the response })
Meow
- dynamicsofscratch
- Scratcher
1000+ posts
Scratch API error handling
(#6)it'd the same but use studios and projectsIs there a way to do this with studios and projects?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:[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));fetch("https://trampoline.turbowarp.org/api/users/BwnnyRxbbit") .then((response) => response.json()) .then((response) => { // do whatever with the response })
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.
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
(#8)hmm. must be limited (as mentioned by ajskateboarder)
It works for projects but not for studios.
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.
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
(#9)You can use any generic CORS proxy(#8)hmm. must be limited (as mentioned by ajskateboarder)
It works for projects but not for studios.
a new scratch api proxy needed…
https://github.com/Rob–W/cors-anywhere
- dynamicsofscratch
- Scratcher
1000+ posts
Scratch API error handling
(#10)he's tryna use the turbowarp one(#9)You can use any generic CORS proxy(#8)hmm. must be limited (as mentioned by ajskateboarder)
It works for projects but not for studios.
a new scratch api proxy needed…
https://github.com/Rob–W/cors-anywhere
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.
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
- Discussion Forums
- » Advanced Topics
- » Scratch API error handling