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.25</version>
<version>1.26</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.25"
compile "com.upstox.api:upstox-java-sdk:1.26"
```

## Sandbox Mode
Expand Down
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Add the following dependency to your `pom.xml`:
| [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 |
| [market-information](./market-information/) | Exchange status, market timings, and holidays |
| [market-information](./market-information/) | Exchange status, market timings, holidays, OI, change in OI, PCR, max pain, FII, and DII |
| [fundamentals](./fundamentals/) | Company profile, balance sheet, cash flow, income statement, key ratios, share holdings, corporate actions, and competitors |
| [gtt-orders](./gtt-orders/) | Good Till Triggered (GTT) order management |
| [margins](./margins/) | Order margin calculations |
| [charges](./charges/) | Brokerage charge calculations |
Expand Down
35 changes: 35 additions & 0 deletions examples/fundamentals/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Fundamentals – Example Code

Links to all company fundamentals examples in the `code/` folder.

## 1. Company Profile

- 1.1 [Get company profile](code/fundamentals.md#get-company-profile)

## 2. Balance Sheet

- 2.1 [Get balance sheet](code/fundamentals.md#get-balance-sheet)

## 3. Cash Flow

- 3.1 [Get cash flow](code/fundamentals.md#get-cash-flow)

## 4. Income Statement

- 4.1 [Get income statement](code/fundamentals.md#get-income-statement)

## 5. Key Ratios

- 5.1 [Get key ratios](code/fundamentals.md#get-key-ratios)

## 6. Share Holdings

- 6.1 [Get share holdings](code/fundamentals.md#get-share-holdings)

## 7. Competitors

- 7.1 [Get competitors](code/fundamentals.md#get-competitors)

## 8. Corporate Actions

- 8.1 [Get corporate actions](code/fundamentals.md#get-corporate-actions)
254 changes: 254 additions & 0 deletions examples/fundamentals/code/fundamentals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
## Get Company Profile

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.CompanyProfileResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";

try {
CompanyProfileResponse result = apiInstance.getCompanyProfile(isin);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Balance Sheet

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.BalanceSheetResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";
String type = "consolidated";
Boolean fs = false;

try {
BalanceSheetResponse result = apiInstance.getBalanceSheet(isin, type, fs);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Cash Flow

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.CashFlowResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";
String type = "consolidated";
Boolean fs = false;

try {
CashFlowResponse result = apiInstance.getCashFlow(isin, type, fs);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Income Statement

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.IncomeStatementResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";
String type = "consolidated";
String timePeriod = "annual";
Boolean fs = false;

try {
IncomeStatementResponse result = apiInstance.getIncomeStatement(isin, type, timePeriod, fs);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Key Ratios

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.KeyRatiosResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";

try {
KeyRatiosResponse result = apiInstance.getKeyRatios(isin);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Share Holdings

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.ShareHoldingsResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";

try {
ShareHoldingsResponse result = apiInstance.getShareHoldings(isin);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Competitors

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.CompetitorsResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String instrumentKey = "NSE_EQ|INE848E01016";

try {
CompetitorsResponse result = apiInstance.getCompetitors(instrumentKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

## Get Corporate Actions

```java
import com.upstox.ApiClient;
import com.upstox.ApiException;
import com.upstox.Configuration;
import com.upstox.api.CorporateActionsResponse;
import com.upstox.auth.OAuth;
import io.swagger.client.api.FundamentalsApi;

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

OAuth OAUTH2 = (OAuth) defaultClient.getAuthentication("OAUTH2");
OAUTH2.setAccessToken("{your_access_token}");

FundamentalsApi apiInstance = new FundamentalsApi();
String isin = "INE848E01016";

try {
CorporateActionsResponse result = apiInstance.getCorporateActions(isin);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling API= " + e.getResponseBody());
e.printStackTrace();
}
}
}
```
19 changes: 17 additions & 2 deletions examples/market-information/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Market Information – Example code
# Market Information – Example Code

Links to all market-information-related examples in the `code/` folder.
Links to all market information and market analytics examples in the `code/` folder.

## 1. Exchange Status

Expand All @@ -14,3 +14,18 @@ Links to all market-information-related examples in the `code/` folder.

- 3.1 [Get market holidays for current year](code/market-holidays.md#get-market-holidays-for-current-year)
- 3.2 [Get market holiday status of a date](code/market-holidays.md#get-market-holiday-status-of-a-date)

## 4. Open Interest (OI)

- 4.1 [Get OI data](code/market-analytics.md#get-oi-data)
- 4.2 [Get change in OI data](code/market-analytics.md#get-change-in-oi-data)

## 5. PCR & Max Pain

- 5.1 [Get PCR data](code/market-analytics.md#get-pcr-data)
- 5.2 [Get max pain data](code/market-analytics.md#get-max-pain-data)

## 6. FII & DII

- 6.1 [Get FII data](code/market-analytics.md#get-fii-data)
- 6.2 [Get DII data](code/market-analytics.md#get-dii-data)
Loading
Loading