Discuss Scratch

apple502j
Scratcher
1000+ posts

★Scratch API with Python★

You can use Scratch APIs in Python programs!

Hello! I made an API client library for Scratch API! You can use it for making stuffs about Scratch.

1. Install scratchapi2
You need:
  • Python 3 or later
  • Internet connection
  • Pico Cookies ($2) of course it's joke.
Run
pip3 install scratchapi2
on terminal.

2. Enjoy
・ Get one's message count
import scratchapi2
username=input("Username:")
print("{0} has {1} messages".format(username, scratchapi2.User(username).unread_messages()))

・Save your project JSON
import scratchapi2
project=input("Project ID:")
scratchapi2.Project(project).save_json("project.json")

3. Contribute
Source code: https://github.com/apple502j/scratchapi2

4. FAQ
Q: What's the difference between original scratchapi?
A: It's completely rewritten. It does not contain things which needs tokens or authentication: however, it contains lots of new APIs!

Q: What does it contain?
A: For example:
  • Project Search
  • Featured Projects API
  • Username Checker
  • Asset Saving
  • Translate API

Q: Is it made by ST?
A: NO.
apple502j
Scratcher
1000+ posts

★Scratch API with Python★

You can even download a whole project: https://github.com/apple502j/download-sb2
(Uses this library)
ninjagolloyd
Scratcher
500+ posts

★Scratch API with Python★

apple502j wrote:

You can even download a whole project: https://github.com/apple502j/download-sb2
(Uses this library)
hasn't this been a thing for a while? i'll drop a link later
apple502j
Scratcher
1000+ posts

★Scratch API with Python★

Bump!
apple502j
Scratcher
1000+ posts

★Scratch API with Python★

We need your help: Add token handlers, please!
https://github.com/apple502j/scratchapi2/issues/10
apple502j
Scratcher
1000+ posts

★Scratch API with Python★

Working on a new version with Studio full-support!
apple502j
Scratcher
1000+ posts

★Scratch API with Python★

Update: No updates will come till ST shows clear guidelines

thisandagain wrote:

@apple502j There is nothing I can do to stop you from making the library, but almost any usage of that library would be against our policies.
https://scratch.mit.edu/users/thisandagain/#comments-56715608

I was so eager to make a new version, Version 2.0, which supports authentication. However, ST said using the library will be against their policies. That means, I cannot test this version either. And, I never want to give you illegal tools.

That said, unless ST gives us a clear API guideline, I never update scratchapi2, neither on PyPI nor GitHub. My new version was almost finished and is about to be released. I'm sad with this, but I cannot do anything.

Most of the functions in released versions use officially-documented APIs. This does not ensure all uses of this library is fine, but I am not going to delete that repository or package.

See you later, guys.
ninjaMAR
Scratcher
1000+ posts

★Scratch API with Python★

Removed

Last edited by ninjaMAR (Aug. 19, 2020 00:20:34)

Jeffalo
Scratcher
1000+ posts

★Scratch API with Python★

ninjaMAR wrote:

I am using this


hmmm….
ahmetlii
Scratcher
500+ posts

★Scratch API with Python★

Jeffalo wrote:

ninjaMAR wrote:

I am using this


hmmm….
Yes , it can be usable for crash the servers with too many requests from API. And it can do things worse with a bot and hooks for sign in sessions.

Last edited by ahmetlii (Aug. 18, 2020 22:03:55)

ninjaMAR
Scratcher
1000+ posts

★Scratch API with Python★

ahmetlii wrote:

Jeffalo wrote:

ninjaMAR wrote:

I am using this


hmmm….
Yes , it can be usable for crash the servers with too many requests from API. And it can do things worse with a bot and hooks for sign in sessions.
it was for school

Last edited by ninjaMAR (Dec. 2, 2020 20:33:08)

Chiroyce
Scratcher
1000+ posts

★Scratch API with Python★

OMG! This is soo useful!!
ninjaMAR
Scratcher
1000+ posts

★Scratch API with Python★

bad post

Last edited by ninjaMAR (March 15, 2021 18:06:42)

Chiroyce
Scratcher
1000+ posts

★Scratch API with Python★

ninjaMAR wrote:

Chiroyce wrote:

OMG! This is soo useful!!

apple502j wrote:

Update: No updates will come till ST shows clear guidelines

thisandagain wrote:

@apple502j There is nothing I can do to stop you from making the library, but almost any usage of that library would be against our policies.
https://scratch.mit.edu/users/thisandagain/#comments-56715608

I was so eager to make a new version, Version 2.0, which supports authentication. However, ST said using the library will be against their policies. That means, I cannot test this version either. And, I never want to give you illegal tools.

That said, unless ST gives us a clear API guideline, I never update scratchapi2, neither on PyPI nor GitHub. My new version was almost finished and is about to be released. I'm sad with this, but I cannot do anything.

Most of the functions in released versions use officially-documented APIs. This does not ensure all uses of this library is fine, but I am not going to delete that repository or package.

See you later, guys.
You are not allowed to use it.

I CANT? Then what am I allowed to use? I see people use NodeJS servers so what module can I use with Python?
Protozan
Scratcher
0 posts

★Scratch API with Python★

can you use cloud variables with this
ninjaMAR
Scratcher
1000+ posts

★Scratch API with Python★

Protozan wrote:

can you use cloud variables with this
no
read the source code and the whole topic
Rendangbike2
Scratcher
1000+ posts

★Scratch API with Python★

thisandagain wrote:

but almost any usage of that library would be against our policies.
Are you sure? Here are some of my points about why that MIGHT not be true:
  • Other people have done it.

    Now, if you commit a bad thing and said it was okay because someone else has done it, It's not a good point. But there are already different API's who collect *common informations.
    Let me think of some on top of my head.


    Ocular,
    ScratchDB,
    Scratch's own API!,
    Shefwerld and
    ScratchStats

    See? Scratch has other third parties whose job is to collect *common informations.
    *I'm referring common as the information that everyone can know about a scratcher like when they join, how many projects does they have, etc.

  • It's okay.

    So thisandagain said it would be against their policy but I don't see any where in ToS or GC that says that it isn't allowed to collect common information. The only thing close is this:

    ToS wrote:

    4.7 All user-generated content is provided as-is. The Scratch Team makes no warranties about the accuracy or reliability of any user-generated content available through Scratch and does not endorse Scratch Day events or vet or verify information posted in connection with said events. The Scratch Team does not endorse any views, opinions, or advice expressed in user-generated content. You agree to relieve the Scratch Team of any and all liability arising from your user-generated content and from Scratch Day events you may organize or host.
    There, It says “does not endorse” but does it say does not allow"? Nope.
I would accept any answer from anyone who is an ST member.

Last edited by Rendangbike2 (Feb. 4, 2021 01:05:14)

mybearworld
Scratcher
1000+ posts

★Scratch API with Python★

Rendangbike2 wrote:

I would accept any answer from anyone who is an ST member.

thisandagain is a ST member.
Rendangbike2
Scratcher
1000+ posts

★Scratch API with Python★

mybearworld wrote:

Rendangbike2 wrote:

I would accept any answer from anyone who is an ST member.

thisandagain is a ST member.
But did he answer?
mybearworld
Scratcher
1000+ posts

★Scratch API with Python★

Rendangbike2 wrote:

mybearworld wrote:

Rendangbike2 wrote:

I would accept any answer from anyone who is an ST member.

thisandagain is a ST member.
But did he answer?
https://scratch.mit.edu/users/thisandagain/#comments-56715608

Powered by DjangoBB