Add an API to my Streamlit app

Please I want to add an API in my app on streamlit and I don’t know how! The API stands for natural language query (NLQ). Thank you

Hi - me again! :slight_smile:

It’d be helpful to clarify if you want your Streamlit app to host an API (i.e. to allow external client apps to call it), or if you want your Streamlit app to call or query external APIs (such as a NLQ to Azure Cognitive Services or OpenAI GTP-3)?

Arvindra

the 2nd option , after integrating my powerBI dashboard in streamlit app i want to call NLQ API to manipulate my data

In that case the requests HTTP library is probably all you need. You should manage API keys or security tokens (if you need authentication) in an external .env of config file. Do not include them in plain text in your Python program.

See: Requests: HTTP for Humans™ — Requests 2.26.0 documentation

1 Like

Thank you i’ll try it