> For the complete documentation index, see [llms.txt](https://docs.openalgo.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openalgo.in/connect-brokers/brokers/5paisa.md).

# 5Paisa

OpenAlgo makes algorithmic trading accessible and straightforward by providing seamless integration with various brokers, including 5Paisa. This documentation will guide you through the process of configuring your 5Paisa account to work with OpenAlgo, ensuring you can automate your trading strategies efficiently. Follow the steps below to generate APIs, and set up your environment for a smooth trading experience.

### **Generate APIs**

**Login to 5Paisa Website:**

* Navigate to the <https://login.5paisa.com/> and log in with your credentials.

<figure><img src="/files/NCvmyoCSRexj4CI8wJd7" alt=""><figcaption></figcaption></figure>

**Access API Key Generation:**

<figure><img src="/files/wU2t4n5kQdRpWyaiAbDc" alt=""><figcaption></figcaption></figure>

* Click on the profile dropdown on the top right next to your name.
* Go to **Xstream API** and click on **Get API Keys**.

<figure><img src="/files/26sHg94JldvqbaHGkcJV" alt=""><figcaption></figcaption></figure>

Keep this page open and navigate to the Dashboard - Create New App.

<figure><img src="/files/j9L3mDgEMxRmcaZylAIp" alt=""><figcaption></figcaption></figure>

### **Save API Details**

Save the generated User Key, User ID. Encryption Key, Later, you will add these details to the environmental variables along with the redirect URL.

<figure><img src="/files/lsNKTzzQSz7YaJR1tEzO" alt=""><figcaption></figcaption></figure>

click on the profile dropdown on the top right corner to know your client code

<figure><img src="/files/YGTsqvCYP4nGNkZyctX1" alt=""><figcaption></figcaption></figure>

Here is a sample of how the details would appear in a .env file for reference:

**Sample .env File:** Here is a sample of how the details should appear in a `.env` file for reference:

```
BROKER_API_KEY = 'API_Key:::User_ID:::client_code'
BROKER_API_SECRET = 'Encryption_Key'
REDIRECT_URL = 'http://127.0.0.1:5000/fivepaisa/callback'
```

#### Conclusion

By following the steps outlined in this guide, you have successfully configured your 5Paisa account for use with OpenAlgo. You can now leverage the power of algorithmic trading to enhance your trading strategies and make data-driven decisions. Should you encounter any issues or need further assistance, please refer to the OpenAlgo community or support resources. Happy trading!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openalgo.in/connect-brokers/brokers/5paisa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
