Skip to content

Repository files navigation

forecastapi-java-sdk

ForecastAPI

  • API version: 2.2.0
    • Build date: 2026-07-24T07:12:18.848167260Z[Etc/UTC]
    • Generator version: 7.16.0

Time series forecasting service with multiple algorithms and automatic method selection

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.forecastapi</groupId>
  <artifactId>forecastapi-java-sdk</artifactId>
  <version>2.2.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'forecastapi-java-sdk' jar has been published to maven central.
    mavenLocal()       // Needed if the 'forecastapi-java-sdk' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.forecastapi:forecastapi-java-sdk:2.2.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/forecastapi-java-sdk-2.2.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.forecastapi.sdk.ApiClient;
import com.forecastapi.sdk.ApiException;
import com.forecastapi.sdk.Configuration;
import com.forecastapi.sdk.auth.*;
import com.forecastapi.sdk.model.*;
import com.forecastapi.sdk.api.AnalysisApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://forecastapi.com");
    
    // Configure API key authorization: apiKey
    ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
    apiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //apiKey.setApiKeyPrefix("Token");

    AnalysisApi apiInstance = new AnalysisApi(defaultClient);
    ForecastRequest forecastRequest = new ForecastRequest(); // ForecastRequest | 
    try {
      AnalysisResponse result = apiInstance.analyzeTimeSeries(forecastRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AnalysisApi#analyzeTimeSeries");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://forecastapi.com

Class Method HTTP request Description
AnalysisApi analyzeTimeSeries POST /v2/analyze Analyze time series data without generating forecast
AnomalyDetectionApi detectAnomalies POST /v2/detect-anomalies Detect anomalies in time series data
BatchForecastingApi createBatchForecast POST /v2/batch/forecast Submit a batch of series for forecasting
BatchForecastingApi getBatchForecast GET /v2/batch/forecast/{batch_id} Poll a batch forecast for status and results
BatchForecastingApi presignBatchForecast POST /v2/batch/forecast/presign Get a presigned URL for a file-based batch upload
ForecastingApi createForecast POST /v2/forecast Generate forecast for time series data
GroupedForecastingApi createGroupedForecast POST /v2/forecast/grouped Submit a grouped (hierarchical) forecast with reconciliation
GroupedForecastingApi getGroupedForecast GET /v2/forecast/grouped/{grouped_forecast_id} Poll a grouped forecast for status and results
HealthApi getApiRoot GET /v2 API root endpoint
HealthApi healthCheck GET /v2/health Health check endpoint
InventoryPlanningApi createInventoryPlan POST /v2/inventory-planning Generate comprehensive inventory planning recommendations
ProductInsightsApi createBatchProductInsights POST /v2/batch/product-insights Submit a batch of products for insights analysis
ProductInsightsApi createProductInsights POST /v2/product-insights Analyze product performance for anomalies, trends and business insights
ProductInsightsApi getProductInsightsBatch GET /v2/batch/product-insights/{batch_id} Poll a product insights batch for status and results
TrafficForecastingApi createTrafficForecast POST /v2/traffic-forecasting Generate traffic forecasting with infrastructure scaling recommendations

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

apiKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

support@forecastapi.com

About

The official ForecastAPI.com Java SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages