Coding Community

How to use the API using Python API enables you to connect your application to Livecoding and its different resources.

In this article, we will use the Django framework and Requests library. The same method can be interpolated to other frameworks and library with ease.


To prepare to use API, register an app on


The first thing we have to do before using API methods is to authorize.

Authorization in API works through standard oAuth protocol, so first we need to implement methods to get an access token with API credentials and later refresh them.

Assume that we have model object with credentials data:

All methods implemented in the Client class:

In auth() method, we make a post request to auth endpoint with an authorization code and then retrieve the access token and refresh token and save them for later use with API requests.

In order to authorise code from authorization server, we have to get request to authorization server:

After successful authorization redirects to our redirect URL, where we can handle authorization code, and continue the auth() procedure.

For convenient use lets create views for it:


Access token has expiration period, so we need periodically refresh it:

API calls

In order to call API methods we need to supply access token with special HTTP header:

“Authorization: Bearer mytoken”

Let implement method to form it:

And now all necessary is ready to retrieve data through API.

For example, we want to get scheduled broadcasts. So we have to make proxy method for API method “scheduledbroadcast”, and for convenient use, we will make the ability to pass any params to it.To avoid access token expiration, we will refresh it on every call.

And then use it like:

In that way, you can use any method supported by API

Have any questions? Don’t forget to comment below and let us know.

About author

I, Dr. Michael J. Garbade is the co-founder of the Education Ecosystem (aka LiveEdu), ex-Amazon, GE, Rebate Networks, Y-combinator. Python, Django, and DevOps Engineer. Serial Entrepreneur. Experienced in raising venture funding. I speak English and German as mother tongues. I have a Masters in Business Administration and Physics, and a Ph.D. in Venture Capital Financing. Currently, I am the Project Lead on the community project -Nationalcoronalvirus Hotline I write subject matter expert technical and business articles in leading blogs like,, Cybrary, Businessinsider,, TechinAsia, Coindesk, and Cointelegraph. I am a frequent speaker and panelist at tech and blockchain conferences around the globe. I serve as a start-up mentor at Axel Springer Accelerator, NY Edtech Accelerator, Seedstars, and Learnlaunch Accelerator. I love hackathons and often serve as a technical judge on hackathon panels.