All URIs are relative to https://api-v2.upstox.com
Method | HTTP request | Description |
---|---|---|
getMarketDataFeed | GET /feed/market-data-feed | Market Data Feed |
getMarketDataFeedAuthorize | GET /feed/market-data-feed/authorize | Market Data Feed Authorize |
getPortfolioStreamFeed | GET /feed/portfolio-stream-feed | Portfolio Stream Feed |
getPortfolioStreamFeedAuthorize | GET /feed/portfolio-stream-feed/authorize | Portfolio Stream Feed Authorize |
getMarketDataFeed(apiVersion)
Market Data Feed
This API redirects the client to the respective socket endpoint to receive Market updates.
// Import classes:
//import com.upstox.ApiClient;
//import com.upstox.ApiException;
//import com.upstox.Configuration;
//import com.upstox.auth.*;
//import io.swagger.client.api.WebsocketApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAUTH2
OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("YOUR ACCESS TOKEN");
WebsocketApi apiInstance = new WebsocketApi();
String apiVersion = "apiVersion_example"; // String | API Version Header
try {
apiInstance.getMarketDataFeed(apiVersion);
} catch (ApiException e) {
System.err.println("Exception when calling WebsocketApi#getMarketDataFeed");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header |
null (empty response body)
WebsocketAuthRedirectResponse getMarketDataFeedAuthorize(apiVersion)
Market Data Feed Authorize
This API provides the functionality to retrieve the socket endpoint URI for Market updates.
// Import classes:
//import com.upstox.ApiClient;
//import com.upstox.ApiException;
//import com.upstox.Configuration;
//import com.upstox.auth.*;
//import io.swagger.client.api.WebsocketApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAUTH2
OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("YOUR ACCESS TOKEN");
WebsocketApi apiInstance = new WebsocketApi();
String apiVersion = "apiVersion_example"; // String | API Version Header
try {
WebsocketAuthRedirectResponse result = apiInstance.getMarketDataFeedAuthorize(apiVersion);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebsocketApi#getMarketDataFeedAuthorize");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header |
getPortfolioStreamFeed(apiVersion)
Portfolio Stream Feed
This API redirects the client to the respective socket endpoint to receive Portfolio updates.
// Import classes:
//import com.upstox.ApiClient;
//import com.upstox.ApiException;
//import com.upstox.Configuration;
//import com.upstox.auth.*;
//import io.swagger.client.api.WebsocketApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAUTH2
OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("YOUR ACCESS TOKEN");
WebsocketApi apiInstance = new WebsocketApi();
String apiVersion = "apiVersion_example"; // String | API Version Header
try {
apiInstance.getPortfolioStreamFeed(apiVersion);
} catch (ApiException e) {
System.err.println("Exception when calling WebsocketApi#getPortfolioStreamFeed");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header |
null (empty response body)
WebsocketAuthRedirectResponse getPortfolioStreamFeedAuthorize(apiVersion)
Portfolio Stream Feed Authorize
This API provides the functionality to retrieve the socket endpoint URI for Portfolio updates.
// Import classes:
//import com.upstox.ApiClient;
//import com.upstox.ApiException;
//import com.upstox.Configuration;
//import com.upstox.auth.*;
//import io.swagger.client.api.WebsocketApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAUTH2
OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("YOUR ACCESS TOKEN");
WebsocketApi apiInstance = new WebsocketApi();
String apiVersion = "apiVersion_example"; // String | API Version Header
try {
WebsocketAuthRedirectResponse result = apiInstance.getPortfolioStreamFeedAuthorize(apiVersion);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebsocketApi#getPortfolioStreamFeedAuthorize");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header |