Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.upstox.api</groupId>
<artifactId>upstox-java-sdk</artifactId>
<version>1.28</version>
<version>1.29</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -40,7 +40,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.upstox.api:upstox-java-sdk:1.28"
compile "com.upstox.api:upstox-java-sdk:1.29"
```

## Sandbox Mode
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add the following dependency to your `pom.xml`:
| [user](./user/) | User profile, fund/margin details, IP management, kill switch |
| [orders](./orders/) | Place, modify, cancel orders and fetch order details |
| [portfolio](./portfolio/) | Positions, holdings, MTF positions, and position conversion |
| [market-quote](./market-quote/) | LTP, OHLC, full market quotes, and option greeks |
| [market-quote](./market-quote/) | LTP, OHLC, full market quotes (v2 and v3), and option greeks |
| [historical-data](./historical-data/) | Historical and intra-day candle data |
| [option-chain](./option-chain/) | Option contracts and put/call option chain |
| [expired-instruments](./expired-instruments/) | Expired instrument data and historical candles |
Expand Down
24 changes: 15 additions & 9 deletions examples/market-quote/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ Links to all market-quote-related examples in the `code/` folder.
- 3.1 [Get Option Greek fields](code/option-greek.md#get-option-greek-fields)
- 3.2 [Get Option Greek fields for multiple instruments keys](code/option-greek.md#get-option-greek-fields-for-multiple-instruments-keys)

## 4. Full Market Quotes
## 4. Full Market Quotes V3

- 4.1 [Get full market quote](code/full-market-quotes.md#get-full-market-quote)
- 4.2 [Get full market quote for multiple instrument keys](code/full-market-quotes.md#get-full-market-quote-for-multiple-instrument-keys)
- 4.1 [Get full market quote](code/full-market-quotes-v3.md#get-full-market-quote)
- 4.2 [Get full market quote for multiple instrument keys](code/full-market-quotes-v3.md#get-full-market-quote-for-multiple-instrument-keys)
- 4.3 [Read individual fields from the full market quote](code/full-market-quotes-v3.md#read-individual-fields-from-the-full-market-quote)

## 5. LTP Quotes
## 5. Full Market Quotes

- 5.1 [Get ltp (last traded price) market quotes](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes)
- 5.2 [Get ltp (last traded price) market quotes for multiple instruments keys](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes-for-multiple-instruments-keys)
- 5.1 [Get full market quote](code/full-market-quotes.md#get-full-market-quote)
- 5.2 [Get full market quote for multiple instrument keys](code/full-market-quotes.md#get-full-market-quote-for-multiple-instrument-keys)

## 6. OHLC Quotes
## 6. LTP Quotes

- 6.1 [Get ohlc market quotes](code/ohlc-quotes.md#get-ohlc-market-quotes)
- 6.2 [Get ohlc market quotes for multiple instrument keys](code/ohlc-quotes.md#get-ohlc-market-quotes-for-multiple-instrument-keys)
- 6.1 [Get ltp (last traded price) market quotes](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes)
- 6.2 [Get ltp (last traded price) market quotes for multiple instruments keys](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes-for-multiple-instruments-keys)

## 7. OHLC Quotes

- 7.1 [Get ohlc market quotes](code/ohlc-quotes.md#get-ohlc-market-quotes)
- 7.2 [Get ohlc market quotes for multiple instrument keys](code/ohlc-quotes.md#get-ohlc-market-quotes-for-multiple-instrument-keys)
107 changes: 107 additions & 0 deletions examples/market-quote/code/full-market-quotes-v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
## Get full market quote

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.GetFullMarketQuoteResponseV3;
import io.swagger.client.api.MarketQuoteV3Api;

public class Main {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setAccessToken("{your_access_token}");

MarketQuoteV3Api apiInstance = new MarketQuoteV3Api();

try {
GetFullMarketQuoteResponseV3 result = apiInstance.getFullMarketQuoteV3("NSE_EQ|INE848E01016");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MarketQuoteV3Api->getFullMarketQuoteV3: " + e.getMessage());
}
}
}
```

## Get full market quote for multiple instrument keys

Up to 500 instrument keys can be requested in a single call.

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.GetFullMarketQuoteResponseV3;
import io.swagger.client.api.MarketQuoteV3Api;

public class Main {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setAccessToken("{your_access_token}");

MarketQuoteV3Api apiInstance = new MarketQuoteV3Api();

try {
GetFullMarketQuoteResponseV3 result =
apiInstance.getFullMarketQuoteV3("NSE_EQ|INE848E01016,NSE_EQ|INE669E01016");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MarketQuoteV3Api->getFullMarketQuoteV3: " + e.getMessage());
}
}
}
```

## Read individual fields from the full market quote

The response `data` map is keyed by trading symbol and each value is a
`MarketQuoteSymbolV3` with typed accessors — including the call-auction
fields (`indicativeEquilibriumPrice`, `indicativeEquilibriumQuantity`,
`indicativeImbalanceQuantityTotal`, `indicativeImbalanceQuantityMarket`,
`referencePrice`, `casEligible`) carried on the v3 feed.

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.GetFullMarketQuoteResponseV3;
import com.upstox.api.MarketQuoteSymbolV3;
import io.swagger.client.api.MarketQuoteV3Api;

import java.util.Map;

public class Main {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setAccessToken("{your_access_token}");

MarketQuoteV3Api apiInstance = new MarketQuoteV3Api();

try {
GetFullMarketQuoteResponseV3 result = apiInstance.getFullMarketQuoteV3("NSE_EQ|INE848E01016");
System.out.println("status: " + result.getStatus());

for (Map.Entry<String, MarketQuoteSymbolV3> entry : result.getData().entrySet()) {
MarketQuoteSymbolV3 quote = entry.getValue();
System.out.println("symbol : " + quote.getSymbol());
System.out.println("instrument token : " + quote.getInstrumentToken());
System.out.println("last price : " + quote.getLastPrice());
System.out.println("volume : " + quote.getVolume());
System.out.println("net change : " + quote.getNetChange());
System.out.println("prev close : " + quote.getPrevClosePrice());
System.out.println("year high / low : " + quote.getYearHigh() + " / " + quote.getYearLow());
System.out.println("oi / previous oi : " + quote.getOi() + " / " + quote.getPreviousOi());
System.out.println("cas eligible : " + quote.getCasEligible());
System.out.println("ind. eq. price : " + quote.getIndicativeEquilibriumPrice());
System.out.println("ind. eq. qty : " + quote.getIndicativeEquilibriumQuantity());
System.out.println("reference price : " + quote.getReferencePrice());
System.out.println("ohlc : " + quote.getOhlc());
System.out.println("depth : " + quote.getDepth());
}
} catch (ApiException e) {
System.err.println("Exception when calling MarketQuoteV3Api->getFullMarketQuoteV3: " + e.getMessage());
}
}
}
```
Loading
Loading