0

I'm using instagrapi which revolves around python:

from instagrapi import Client;

app = Client()
app.login('username', 'password')

medias = app.user_medias('user_id')
print(medias)

Now, the python app returns an application/json response, which I'd like to use in my typescript app.

The main question is: How do I link python to a typescript app?

I'd like to receive my response from python which I want to use in the typescript app. I'm looking for ideas / methods to do so.

I wanted to use sqlite as a medium to transfer data, but as the app would be used by at least 100 users, sqlite wouldn't be a consistent way to get the job done

Darshan B
  • 658
  • 1
  • 5
  • 19
  • Is that Typescript app for node.js or a browser? Why even use Python at all? A quick search shows there are API implementations for node.js (no idea how good they are) – Jared Smith May 04 '23 at 12:19
  • typescript for node.js, oh and I tried other API implementations and they don't seem to work as good as `instagrapi`... moreover the rest version of it returns a `403` error – Darshan B May 04 '23 at 13:40
  • Just have a python script that calls the API and dumps the result to STDOUT, probably as JSON which you can then parse back into data on the TS side. – Jared Smith May 04 '23 at 13:44

0 Answers0