Trend Forecasting: Future Data Prediction, Array Extension, and Trend Analysis API
Overview
This document outlines a forecasting solution that provides an HTTP-based API for predicting future values based on input arrays.
# Example
input 1,2,3,4,5
output 6,7,8
# Example
input 2,4,6,8,10
output 12,14,16,18
The API requires a payment of 0.1 cent per call (a small contribution to support development). Interested parties may also purchase the source code, which is implemented in Java. Contact via WeChat xujian_cq for more information.
Access to the required authentication code can be obtained by using the mini-program "Digital Continuation" and signing in on its homepage.
For those in a hurry, jump to section 2.4 for sample responses.
API Functionality
- Exposes a public endpoint where developers can submit a double array of any length.
- Returns a specified number of predicted subsequent values.
API Usage
2.1 Key Parameters
- Input Parameters
| Index | Parameter | Value | Description |
|---|---|---|---|
| 1 | Endpoint | https://www.xujian.tech/atlapi/data/c/trend/{code} | |
| 2 | Method | POST: application/json | |
| 3 | Parameter 1 | code | Unique identifier obtained from the mini-program "Digital Continuation", remains constant |
| 4 | Parameter 2 | list | Comma-separated array values, e.g., 1.2,2.3,4.5,6,7 |
| 5 | Parameter 3 | futurePoints | Number of forecasted points, positive integer |
| 6 | Parameter 4 | degree | Regression order, default is 2 |
Note on degree: Adjust the regression order depending on data behavior. Use 1 for linear trends, 2 for quadratic patterns, and so forth.
Important: Keep the code secure and unchanged.
- Output Format
| Index | Field | Type | Description |
|---|---|---|---|
| 1 | Resposne Format | JSONObject | Contains code, data, and msg |
| 2 | code | Integer | 200 indicates succsess; others indicate failure |
| 3 | msg | String | Success message or error description |
| 4 | data | Double Array | Predicted values upon successful execution |
2.2 Result Handling
On successful execution, the data field contains the forecasted values.
2.3 Request Examples
Example requests via Postman are shown below.
Three test cases are available to demonstrate functionality.
2.4 Sample Response
{
"code": 200,
"msg": "succeed.",
"data": [
2.9333333333333327,
2.961904761904761,
2.9904761904761896,
3.019047619047618,
3.0476190476190466
]
}
Payment Details
Each API call costs 0.1 cent. Source code availability is also offered upon request. Appreciate your suppport!
Implementation is done in Java.