> 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/pocketful.md).

# Pocketful

***

### Pocketful

Pocketful is a SEBI-registered Indian stock broker offering a modern trading platform with support for multiple asset classes and a powerful API suite. With a focus on automation, speed, and flexibility, Pocketful provides developers and trading system builders direct access to its brokerage services through the [developer portal](https://api.pocketful.in/).

For OpenAlgo integration, Pocketful enables algorithmic trading with secure API authentication, real-time data streaming, and efficient order placement across equities and derivatives.

***

#### App Registration and API Credentials

The integration begins with creating an app via the Pocketful Developer Portal. This app generates the required credentials for secure API access.

***

**Step-by-Step Guide to Registering Your App**

**Step 1: Visit the Developer Portal**\
Go to [https://api.pocketful.in](https://api.pocketful.in/) and log in with your registered email ID or client ID.

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2FdVquqhCILFM4myBeqj7Y%2Fimage.png?alt=media&amp;token=d7aa7882-0eaf-4953-a21f-5195c0920d12" alt=""><figcaption></figcaption></figure>

**Step 2: Navigate to 'Apps' and Create a New App**\
Click on “+ Create App”.

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2FZgX1Dc2WEB1ReUJjfKrM%2Fimage.png?alt=media&amp;token=56f37e5d-37c8-48a6-8f82-fe38df4e4863" alt=""><figcaption></figcaption></figure>

**Step 3: Fill App Details**

* App Name: `OpenAlgo`
* Redirect URL: `http://127.0.0.1:5000/pocketful/callback`
* Accept the terms and conditions and click **Create App**

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2FFwgwWUBvZ0BhKze5Q7cb%2Fimage.png?alt=media&amp;token=7f5f674e-59eb-40d2-9488-125b89d18506" alt=""><figcaption></figcaption></figure>

Once created, the following credentials will be generated:

* App ID: use as `API_KEY`
* App Secret: use as `API_SECRET`

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2F81M5ahl94QSqipLyh8Iu%2Fimage.png?alt=media&amp;token=21d0e4a5-e5af-4378-ae15-8a7f4248de19" alt=""><figcaption></figcaption></figure>

***

#### API Authentication

Pocketful follows OAuth2-based authentication using redirect URI and access tokens. After app creation, OpenAlgo uses the client credentials to initiate authorization and securely fetch access tokens.

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

```env
BROKER_API_KEY = 'your_app_id_here'
BROKER_API_SECRET = 'your_app_secret_here'
REDIRECT_URL = 'http://127.0.0.1:5000/pocketful/callback'
```

***

#### Connecting Pocketful to OpenAlgo

Once your `.env` file is populated with the credentials, restart OpenAlgo, open the broker page and click **Connect**. OpenAlgo builds the authorization URL from your credentials and sends you to `https://trade.pocketful.in/oauth2/auth`.

After you sign in, Pocketful redirects back to `http://127.0.0.1:5000/pocketful/callback` with an authorization code, which OpenAlgo exchanges for an access token and stores locally. That completes the authentication process.

***

Integrating OpenAlgo with Pocketful's API allows traders and developers to leverage a powerful, cost-effective, and scalable infrastructure for building and deploying fully automated trading strategies. To ensure smooth performance, it is advisable to manage API limits, rotate tokens securely, and build retry/error-handling logic in production systems.

***

### Supported Exchanges

OpenAlgo reads this plugin's exchange list from `broker/pocketful/plugin.json` and serves it to the app, so symbol search, the Strategy Builder and the tools pages only offer what the plugin actually handles.

* **Tradable:** `NSE`, `BSE`, `NFO`, `BFO`, `MCX`
* **Index feeds:** `NSE_INDEX`, `BSE_INDEX`
