Official Java client for Indices-API – the ultimate API for accessing comprehensive and accurate real-time and historical rates on a wide range of financial indices.
Indices-API supports many index symbols with frequent updates (depending on your plan). Start a 7‑day free trial and cancel anytime.
- Built for developers: Simple, easy-to-use API designed for Java 11+.
- Robust JSON API: Thin, predictable wrapper over the Indices-API JSON endpoints.
- Top-tier security: Your API key is sent over HTTPS to trusted, enterprise-grade infrastructure.
- Reliable data sources: Data aggregated from reputable financial and market data providers.
- Historical data access: Query historical and time-series data for deeper analysis.
- Exceptional accuracy: Real-time and historical index data with high precision.
- User-friendly documentation: See the full API docs at https://indices-api.com/documentation.
- Specialized support: Dedicated support team to help with integration and use-cases.
Indices-API covers a wide range of instruments, including (examples):
- Equity indices: S&P 500, Nasdaq 100, Dow Jones, FTSE 100, and more.
- Regional indices: European, Asian, and emerging market indices.
- Sector indices: Technology, financials, energy, and other sector-based benchmarks.
You can find the full, always up-to-date list of supported symbols in the Supported Indices section of the official documentation.
- Add the JitPack repository:
// build.gradle
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}- Add dependency:
dependencies {
implementation 'com.github.Zyla-Labs:indices-java-sdk:0.1.0'
}<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Zyla-Labs</groupId>
<artifactId>indices-java-sdk</artifactId>
<version>0.1.0</version>
</dependency>First, sign up at https://indices-api.com to get your API key and some free credits.
import com.indices.api.IndicesClient;
import java.util.Map;
public class Example {
public static void main(String[] args) {
IndicesClient client = new IndicesClient("REPLACE-WITH-YOUR-ACCESS-KEY");
Map<String, Object> latest = client.getLatest("USD", "000001,IXIC,GSPC,EGX-30");
System.out.println(latest);
Map<String, Object> historical = client.getHistorical("2024-05-15", "USD", "000001,IXIC,GSPC,EGX-30");
System.out.println(historical);
}
}Example response for a successful getLatest request (shape may vary depending on plan and endpoint):
{
"success": true,
"timestamp": 1715796300,
"date": "2024-05-15",
"base": "USD",
"rates": {
"000001": 3025.15,
"IXIC": 18450.33,
"GSPC": 5231.57,
"EGX-30": 27500.42,
"USD": 1
},
"unit": {
"000001": "index points",
"IXIC": "index points",
"GSPC": "index points",
"EGX-30": "index points"
}
}The exact structure of the data object depends on the endpoint and your plan. Refer to the official documentation for the complete schema.
All methods live on the IndicesClient class.
| Method | Description |
|---|---|
getLatest(base, symbols) |
Fetches the most recent rates for the requested symbols. |
getHistorical(date, base, symbols) |
Get historical rates for a given date (YYYY-MM-DD). |
getTimeSeries(startDate, endDate, base, symbols) |
Retrieve time-series data between two dates. |
getFluctuation(startDate, endDate, base, symbols) |
Get day-to-day or period fluctuation data. |
convert(from, to, amount, date) |
Convert an amount between two symbols. |
getSymbols() |
List available symbols and their metadata (depends on plan). |
// Latest rates
client.getLatest("USD", "000001,IXIC,GSPC,EGX-30");
// Historical
client.getHistorical("2024-05-15", "USD", "000001,IXIC,GSPC,EGX-30");
// Time series
client.getTimeSeries("2024-05-01", "2024-05-15", "USD", "000001,IXIC,GSPC,EGX-30");
// Fluctuation
client.getFluctuation("2024-05-01", "2024-05-15", "USD", "000001,IXIC,GSPC,EGX-30");
// Convert
client.convert("GSPC", "IXIC", 100.0, null); // date optional
// Symbols
client.getSymbols();All requests may throw an IndicesApiException when:
- The API returns an error payload, or
- The network fails, or
- The response is not valid JSON.
import com.indices.api.IndicesClient;
import com.indices.api.IndicesApiException;
public class ExampleErrorHandling {
public static void main(String[] args) {
try {
IndicesClient client = new IndicesClient("REPLACE-WITH-YOUR-ACCESS-KEY");
var latest = client.getLatest("USD", "000001,IXIC,GSPC,EGX-30");
System.out.println(latest);
} catch (IndicesApiException e) {
System.err.println("Message: " + e.getMessage());
System.err.println("Status: " + e.getStatusCode());
System.err.println("Code: " + e.getErrorCode());
}
}
}- Create the repository on GitHub:
https://github.com/Zyla-Labs/indices-java-sdk. - Push
pom.xml,src/,README.md, andLICENSE. - Create a tag
v0.1.0(or0.1.0):
git tag v0.1.0
git push origin v0.1.0- Go to https://jitpack.io, paste the repo URL and build.
- Use the dependency in your project:
com.github.Zyla-Labs:indices-java-sdk:0.1.0.
- API documentation: https://indices-api.com/documentation
- Website: https://indices-api.com
If you have questions or need help with integration, please reach out through the official support channels listed in the Indices-API dashboard.