Using the API with Grist Desktop

Is there a way to use the API with Grist-Desktop?

I am evaluating Grist as a lightweight tool to capture Systems Engineering data.

During the evaluation phase, I am using grist-desktop as it is fully offline; however I would like to test accessing the data externally to generate reports. The API appears to be the most powerful tool for doing this, as reading the raw .grist file with an SQLite viewer doesn’t let you understand the links between tables. Using the API would also let me port my code over when my company either self-hosts or gets a paid Grist account.

Is there a way to use the API with Grist-Desktop, or to otherwise see the links between tables in .grist files?

The API Console isn’t working on my Windows copy of Grist Desktop and the Base doc URL serves up “access denied” to me

Note that someone asked this question last year, but there was no comment on whether or not you could use the API. Using API with Grist Desktop

1 Like

Check the GRIST_DESKTOP_AUTH setting mentioned in the README. For a Desktop app, we default to not making the API available outside the app, but you can change that if you want.

I think GRIST_DESKTOP_AUTH=none may be what you want if you have no particular security concerns.

1 Like

Thank you! This will allow me to demo in a sandboxed environment

1 Like

oh good to know! I should mention this somewhere also in Pygrister’s docs…

That said, in the OP use case, I would probably advise setting up a “real” Grist in a Docker container instead…

1 Like

Thank you! After solving the auth and network access problem, I still need to know at which port the API will be available.

The docs you shared said that it is not recommended to manually set the GRIST_PORT, since Grist Desktop will randomly pick one available in my system.

But now I wonder: how can I know which port Grist Desktop chose?