Glitch API Docs

Hello everybody! Help me please. Can anyone have a Glitch API? Give a link to the documentation if available. :slight_smile:

1 Like

The Glitch API is not ready for public consumption yet so there are no official docs, but I am sure someone can help you out :slight_smile: I’ve never used it myself

Eddie

Thank you the answer :slight_smile:

There is simply a module that allows you to use the Glitch API. I checked it, but essentially nothing worked.

ScreenShot

Yes, that’s the Glitch API npm package by @jarvis394.

1 Like

@khalby786,I put it yesterday. The package does not work.

Yes, it does. If you know how to use it.

@khalby786, I know. I opened the documentation. But my VSCode did not want to work with him.

And why is that?  

@khalby786, Honestly I do not know. I thought it did not work. After all, the Glitch API is not yet publicly available.

Make sure you have Git and npm installed.

Sorry, to clarify, it is available for you to use, it’s just not ready/designed for you to use it (e.g. public consumption)
Sorry if I confused you there.
Eddie

Hello @xyligan,
Can you please describe what’s gone wrong? Can you share screenshots or logs from the package examples?

1 Like

Uff … I uninstalled the module already unfortunately …

Could you please remember what didn’t work with your VSC? Have you used a Glitch user’s token?

I can give only the sample code that I wrote.

const { Glitch } = require('glitch-api');
const glitch = new Glitch({ token: 'my token' });
const { api } = glitch;

if(cmd === `${prefix}project`) {
    let messageArray = message.content.split(' ');
    let cmd = messageArray[0];
    let args = messageArray.slice(1);

    api.projects.search(args[0]);
}

I received the token in the browser console by writing the following command:

(JSON.parse(localStorage.getItem('cachedUser'))).PersistentToken

@jarvis394, I use this docs: Click

Yep, searching is broken because Glitch now uses Algolia API. I’ll see what I can do here.

Also, .search returns Promise, therefore you have to use .then construction or async/await.

I think you can use projects.get with project domain: https://glapi.ml/classes/projects#get

const project = await api.projects.get({ domain })