# Request a Forecast
Source: https://nolanoinc.mintlify.app/api-reference/endpoint/forecast
POST /forecast
Generate accurate time series predictions using Nolano's foundation models
Generate predictions for your time series data using state-of-the-art foundation models. This endpoint supports univariate forecasting with multiple model options optimized for different use cases.
**Processing Time**: Forecasts typically complete in 2-10 seconds depending on data size and model complexity.
## Available Models
Choose the best model for your forecasting needs. Each model is optimized for specific use cases and data characteristics:
| Model ID | Description | Best For |
| ------------------ | --------------------------------------- | ------------------------- |
| `forecast-model-1` | General-purpose foundation model (TOTO) | Most time series patterns |
| `forecast-model-2` | Trend-focused model | Data with strong trends |
| `forecast-model-3` | Seasonal model | Seasonal patterns |
| `forecast-model-4` | Volatility model | High-variance data |
For detailed model information and performance characteristics, see our [Supported Models](/models) page.
## Example Requests
```bash Daily Sales Forecast theme={null}
curl --location 'https://api.nolano.ai/forecast' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ak_your_api_key_here' \
--header 'X-Model-Id: forecast-model-1' \
--data '{
"series": [
{
"timestamps": [
"2023-01-01T00:00:00",
"2023-01-02T00:00:00",
"2023-01-03T00:00:00",
"2023-01-04T00:00:00",
"2023-01-05T00:00:00"
],
"values": [100, 102, 98, 105, 103]
}
],
"forecast_horizon": 7,
"data_frequency": "Daily",
"forecast_frequency": "Daily",
"confidence": 0.95
}'
```
```python Python with Pandas theme={null}
import requests
import pandas as pd
import json
# Sample time series data
data = {
'date': pd.date_range('2023-01-01', periods=30, freq='D'),
'sales': [100 + i * 2 + (i % 7) * 5 for i in range(30)]
}
df = pd.DataFrame(data)
request_payload = {
"series": [{
"timestamps": df['date'].dt.strftime('%Y-%m-%dT%H:%M:%S').tolist(),
"values": df['sales'].tolist()
}],
"forecast_horizon": 7,
"data_frequency": "Daily",
"forecast_frequency": "Daily",
"confidence": 0.95
}
response = requests.post(
"https://api.nolano.ai/forecast",
headers={
'Content-Type': 'application/json',
'Authorization': "Bearer ak_your_api_key_here",
'X-Model-Id': 'forecast-model-1'
},
json=request_payload
)
if response.status_code == 200:
forecast = response.json()
print("Forecast successful!")
print(f"Predicted values: {forecast['median']}")
else:
print(f"Error: {response.status_code}")
print(response.json())
```
```javascript Node.js theme={null}
const axios = require('axios');
const forecastData = {
series: [{
timestamps: [
"2023-01-01T00:00:00",
"2023-01-02T00:00:00",
"2023-01-03T00:00:00",
"2023-01-04T00:00:00",
"2023-01-05T00:00:00"
],
values: [100, 102, 98, 105, 103]
}],
forecast_horizon: 7,
data_frequency: "Daily",
forecast_frequency: "Daily",
confidence: 0.95
};
axios.post('https://api.nolano.ai/forecast', forecastData, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ak_your_api_key_here',
'X-Model-Id': 'forecast-model-1'
}
})
.then(response => {
console.log('Forecast successful!');
console.log('Predicted values:', response.data.median);
})
.catch(error => {
console.error('Error:', error.response?.data || error.message);
});
```
## Response Format
The API returns forecast data with prediction intervals:
```json Example Response theme={null}
{
"forecast_timestamps": [
"2024-01-01T00:00:00",
"2024-01-02T00:00:00",
"2024-01-03T00:00:00"
],
"lower_bound": [145.2, 146.8, 148.1],
"median": [150.0, 151.5, 153.2],
"upper_bound": [154.8, 156.2, 158.3]
}
```
## Data Requirements
* **Minimum data points**: 10 historical observations
* **Maximum forecast horizon**: 100 periods
* **Supported frequencies**: Seconds, Minutes, Hours, Daily, Weekly, Monthly, Quarterly, Yearly
* **Data format**: Chronologically ordered timestamps with corresponding numerical values
## Error Handling
The API returns structured error responses with specific error codes:
* `UNAUTHORIZED` - Invalid or missing API key
* `INVALID_REQUEST` - Validation failed for request parameters
* `DATA_VALIDATION_ERROR` - Issues with time series data format
* `RATE_LIMIT_EXCEEDED` - API rate limit exceeded
* `INTERNAL_ERROR` - Unexpected server error
Always check the HTTP status code and parse the error object for detailed information about failures.
# Verify API Key
Source: https://nolanoinc.mintlify.app/api-reference/endpoint/verify
GET /verify
Verify that your API key is valid and check rate limit status
Use this endpoint to verify that your API key is valid and check your current rate limit status. This is useful for debugging authentication issues and monitoring your API usage.
## Quick Test
The verify endpoint is perfect for:
* Testing new API keys
* Checking rate limit status
* Debugging authentication issues
* Monitoring API permissions
## Example Usage
```bash cURL theme={null}
curl -X GET "https://api.nolano.ai/verify" \
-H "Authorization: Bearer ak_your_api_key_here" \
-H "Content-Type: application/json"
```
```python Python theme={null}
import requests
response = requests.get(
"https://api.nolano.ai/verify",
headers={
"Authorization": "Bearer ak_your_api_key_here",
"Content-Type": "application/json"
}
)
if response.status_code == 200:
data = response.json()
print(f"✅ API key is valid")
print(f"Permissions: {data['apiKey']['permissions']}")
print(f"Rate limit: {data['rateLimit']['remaining']}/{data['rateLimit']['limit']}")
else:
print(f"❌ Authentication failed: {response.status_code}")
print(response.json())
```
```javascript JavaScript theme={null}
const response = await fetch('https://api.nolano.ai/verify', {
headers: {
'Authorization': 'Bearer ak_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
if (response.ok) {
console.log('✅ API key is valid');
console.log('Permissions:', data.apiKey.permissions);
console.log(`Rate limit: ${data.rateLimit.remaining}/${data.rateLimit.limit}`);
} else {
console.log('❌ Authentication failed:', response.status);
console.log(data);
}
```
## Response Fields
The verify endpoint returns detailed information about your API key:
* **success**: Boolean indicating if the key is valid
* **message**: Human-readable status message
* **timestamp**: Server timestamp of the verification
* **apiKey.permissions**: Array of permissions for your key
* **rateLimit**: Current rate limit status including remaining requests
## Rate Limit Information
The response includes your current rate limit status:
```json Example Rate Limit Response theme={null}
{
"rateLimit": {
"limit": "1000",
"remaining": "999",
"resetTime": "1755044460000"
}
}
```
Use this information to avoid hitting rate limits in your applications.
# API Reference
Source: https://nolanoinc.mintlify.app/api-reference/introduction
Complete reference for the Nolano time series forecasting API
## Welcome to Nolano API Platform
The Nolano API delivers enterprise-grade Time Series Foundation Models for forecasting and anomaly detection, with secure authentication, robust key management, and AWS-powered reliability, security, and scalability.
`https://api.nolano.ai`
4+ Time Series Foundation Models
## Quick Start
Get up and running with the Nolano API in under 5 minutes:
Sign up at [app.nolano.ai](https://app.nolano.ai) and generate your API key from the dashboard.
Verify your API key is working:
```bash theme={null}
curl -H "Authorization: Bearer your_api_key_here" https://api.nolano.ai/verify
```
Use the `/forecast` endpoint to predict future values:
```bash theme={null}
curl -X POST https://api.nolano.ai/forecast \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"series":[{"timestamps":["2023-01-01T00:00:00","2023-01-02T00:00:00"],"values":[100,102]}],"forecast_horizon":5,"data_frequency":"Daily","forecast_frequency":"Daily"}'
```
## Authentication
All API endpoints require authentication using API keys in the `Authorization` header.
### API Key Format
```
Authorization: Bearer ak_[64_character_hex_string]
```
API keys always start with `ak_` followed by a 64-character hexadecimal string.
### Verify Authentication
Test your API key with the verification endpoint:
```bash cURL theme={null}
curl -X GET "https://api.nolano.ai/verify" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json"
```
```python Python theme={null}
import requests
response = requests.get(
"https://api.nolano.ai/verify",
headers={
"Authorization": "Bearer your_api_key_here",
"Content-Type": "application/json"
}
)
print(response.json())
```
```javascript JavaScript theme={null}
const response = await fetch('https://api.nolano.ai/verify', {
headers: {
'Authorization': 'Bearer your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
```
**Success Response:**
```json theme={null}
{
"success": true,
"message": "API key is valid and working correctly",
"timestamp": "2025-01-17T00:20:24.435Z",
"apiKey": {
"permissions": ["read"]
},
"rateLimit": {
"limit": "1000",
"remaining": "999",
"resetTime": "1755044460000"
}
}
```
## Rate Limits
API requests are limited based on your API key's permission level:
| Permission Level | Requests/Min | Requests/Hour | Requests/Day |
| ---------------- | ------------ | ------------- | ------------ |
| **Read Only** | 50 | 500 | 10,000 |
| **Read/Write** | 100 | 1,000 | 50,000 |
| **Admin** | 200 | 2,000 | 100,000 |
| **Full Access** | 500 | 5,000 | 250,000 |
### Rate Limit Headers
Every API response includes rate limit information:
```http theme={null}
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1755044460
```
### Handling Rate Limits
When you exceed your rate limit, you'll receive a `429 Too Many Requests` response:
```json theme={null}
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "API rate limit exceeded",
"details": {
"limit": 1000,
"reset_time": "2025-01-17T01:00:00Z"
}
}
}
```
Implement exponential backoff when handling rate limit errors to avoid repeated failures.
## API Key Security
* **Secure Storage**: API keys are hashed using SHA-256 before storage
* **Usage Tracking**: All API calls are logged with usage statistics
* **Instant Revocation**: Immediately revoke compromised keys through the dashboard
* **Environment Variables**: Store keys in environment variables, never in source code
Never expose API keys in client-side code or public repositories. Keys should only be used in secure server-side environments.
## Contact Us
Have questions about the API or need technical assistance? Our team is here to help!
**Email:** [hello@nolano.ai](mailto:hello@nolano.ai)
We typically respond within 24 hours during business days.
# Formatting Input Data
Source: https://nolanoinc.mintlify.app/data-format-setup
Learn about the required data format for time series forecasting with Nolano
## Data Format Requirements
### Time Series Structure
Your time series data must follow this JSON structure:
```json theme={null}
{
"series": [
{
"timestamps": ["2023-01-01T00:00:00", "2023-01-02T00:00:00", "2023-01-03T00:00:00"],
"values": [100, 102, 98]
}
],
"forecast_horizon": 7,
"data_frequency": "Daily",
"forecast_frequency": "Daily",
"confidence": 0.95
}
```
### Timestamp Format
All timestamps must be in ISO 8601 format: `YYYY-MM-DDTHH:MM:SS`
**Examples:**
* `2023-01-01T00:00:00` (Daily data)
* `2023-01-01T10:30:00` (Hourly data)
* `2023-01-01T10:30:45` (Minute-level data)
Use consistent timezone formatting. We recommend UTC for global applications.
The API supports these data frequencies:
* **Seconds**: High-frequency data (e.g., stock prices, sensor readings)
* **Minutes**: Sub-hourly data (e.g., website traffic, IoT metrics)
* **Hours**: Hourly data (e.g., energy consumption, temperature)
* **Daily**: Daily data (e.g., sales, website visits)
* **Weekly**: Weekly aggregations (e.g., weekly revenue, user growth)
* **Monthly**: Monthly data (e.g., monthly sales, subscription metrics)
* **Quarterly**: Quarterly data (e.g., quarterly earnings, seasonal trends)
* **Yearly**: Annual data (e.g., yearly revenue, long-term trends)
### Data Quality Requirements
**Daily/Weekly**: At least 30 data points
**Monthly/Quarterly**: At least 12 data points
**Yearly**: At least 5 data points
**Hourly/Minutes/Seconds**: At least 100 data points
No missing values in timestamps or values arrays
Arrays must have equal length
Values must be numeric (integers or floats)
Timestamps must be in chronological order
## Data Preparation Best Practices
### 1. Data Cleaning
Before sending data to the API, ensure you've handled missing values:
```python theme={null}
# Example: Forward fill missing values
import pandas as pd
df = pd.DataFrame({
'timestamp': timestamps,
'value': values
})
df = df.fillna(method='ffill') # Forward fill
# or
df = df.interpolate() # Linear interpolation
```
Consider removing or smoothing extreme outliers that could skew forecasts:
```python theme={null}
# Example: Remove outliers using IQR method
Q1 = df['value'].quantile(0.25)
Q3 = df['value'].quantile(0.75)
IQR = Q3 - Q1
df_clean = df[
(df['value'] >= Q1 - 1.5 * IQR) &
(df['value'] <= Q3 + 1.5 * IQR)
]
```
### 2. Seasonality Considerations
For daily data, consider day-of-week patterns. Include at least 4 weeks of data to capture weekly seasonality.
For monthly data, include at least 2 years of data to capture annual seasonality patterns.
### 3. Data Granularity
**Choose the right frequency**: Use the highest frequency that makes sense for your use case. Higher frequency data can capture more patterns but requires more data points.
## Setup Considerations
### API Configuration
Choose the appropriate model based on your data characteristics:
* **forecast-model-1**: General purpose, good for most use cases
* **forecast-model-2**: Better for complex seasonal patterns
* **forecast-model-3**: Optimized for high-frequency data
* **forecast-model-4**: Advanced deep learning for complex patterns
Set your forecast horizon based on your business needs:
* **Short-term**: 1-7 periods for immediate planning
* **Medium-term**: 8-30 periods for operational planning
* **Long-term**: 30+ periods for strategic planning
Longer forecast horizons generally have higher uncertainty. Consider using confidence intervals for planning.
## Common Data Patterns
### Example: E-commerce Sales Data
```json theme={null}
{
"series": [
{
"timestamps": [
"2023-01-01T00:00:00", "2023-01-02T00:00:00", "2023-01-03T00:00:00",
"2023-01-04T00:00:00", "2023-01-05T00:00:00", "2023-01-06T00:00:00",
"2023-01-07T00:00:00", "2023-01-08T00:00:00", "2023-01-09T00:00:00",
"2023-01-10T00:00:00"
],
"values": [1200, 1350, 1100, 1400, 1600, 1800, 2200, 1500, 1300, 1400]
}
],
"forecast_horizon": 14,
"data_frequency": "Daily",
"forecast_frequency": "Daily",
"confidence": 0.95
}
```
### Example: Website Traffic (Hourly)
```json theme={null}
{
"series": [
{
"timestamps": [
"2023-01-01T00:00:00", "2023-01-01T01:00:00", "2023-01-01T02:00:00",
"2023-01-01T03:00:00", "2023-01-01T04:00:00", "2023-01-01T05:00:00"
],
"values": [150, 120, 80, 60, 50, 70]
}
],
"forecast_horizon": 24,
"data_frequency": "Hours",
"forecast_frequency": "Hours",
"confidence": 0.90
}
```
## Troubleshooting
**"Invalid timestamp format"**: Ensure timestamps are in ISO 8601 format
**"Arrays must have equal length"**: Check that timestamps and values arrays have the same number of elements
**"Insufficient data points"**: Add more historical data points
**"Invalid frequency"**: Use one of the supported frequency values
* Use consistent time intervals when possible
* Pre-process data to remove noise and outliers
* Consider data seasonality when choosing forecast horizon
* Test with smaller datasets before processing large volumes
## Next Steps
Follow the quickstart guide to make your first forecast request with properly formatted data.
Explore the complete API reference for detailed parameter documentation.
# API Keys
Source: https://nolanoinc.mintlify.app/essentials/api-keys
Complete guide to managing API keys for the Nolano forecasting API
## Managing API Keys
You can manage your API keys through the Nolano dashboard.
The dashboard provides an easy-to-use interface for all your API key management needs.
## What are API Keys?
API keys are unique identifiers that authenticate your requests to the Nolano API. They act as both an identifier and a password, ensuring that only authorized users can access forecasting services and manage API resources.
## Key Features
### Secure by Design
Keys are hashed before storage - original keys are never stored in plain text
Every API call is logged with detailed usage statistics and monitoring
Set custom expiration dates or create keys that never expire
Immediately revoke compromised keys with audit trails
### Storage and Handling
**Never expose API keys in client-side code**: API keys should only be used in server-side applications where they can be kept secure.
**Environment Variables**: Store API keys in environment variables, not in your source code.
```bash theme={null}
# ✅ Good: Environment variable
export NOLANO_API_KEY="ak_577aa2f186866ec0c75d1068bcff79cd3da4344b80aec1572e0fa07b364227d6"
# ❌ Bad: Hardcoded in source
api_key = "ak_577aa2f186866ec0c75d1068bcff79cd3da4344b80aec1572e0fa07b364227d6"
```
### Regular Rotation (Coming soon)
Implement a regular key rotation schedule:
1. **Production Keys**: Rotate every 90 days
2. **Development Keys**: Rotate every 30 days
3. **Emergency Rotation**: Immediately if compromise suspected
## Rate Limits by Key Type
| Permission Level | Requests/Min | Requests/Hour | Requests/Day |
| ---------------- | ------------ | ------------- | ------------ |
| **Read Only** | 50 | 500 | 10,000 |
| **Read/Write** | 100 | 1,000 | 50,000 |
| **Admin** | 200 | 2,000 | 100,000 |
| **Full Access** | 500 | 5,000 | 250,000 |
**Enterprise Plans**: Custom rate limits and dedicated support available. Contact [hello@nolano.com](mailto:hello@nolano.com) for details.
# Introduction
Source: https://nolanoinc.mintlify.app/index
*Foundational model for time series forecasting and anomaly detection*
## Nolano API Platform
Nolano provides ready-to-use Time Series Foundation Models through a simple API interface. Built for developers, our platform makes time series forecasting fast, accurate, and accessible across multiple domains including finance, weather, energy, and healthcare.
### The Timeseries Foundation Model (TSFM)
A time series foundation model is a large, pre-trained model designed to understand and forecast temporal data across many domains. Unlike traditional forecasting models built from scratch for each dataset, TSFM can perform zero-shot or few-shot forecasting on new tasks without full retraining.
### ✨ Key Benefits
Achieve better forecasting results with advanced foundation model
Get predictions in milliseconds with real-time forecasting capabilities
Simple API integration with minimal setup and configuration required
TSFM delivers superior results with minimal effort compared to traditional approaches. No extensive preprocessing, parameter tuning, or significant computational resources required.
## 🎯 Core Capabilities
Advanced forecasting with state-of-the-art models for accurate predictions
Detect anomalies and outliers in your time series data with precision
Monitor your data streams in real-time with instant alerts and insights
## Get Started
Get your first forecast request running in minutes
Browse our complete collection of Time Series Foundation Models
## 💬 Need Help?
Have questions about the API or need technical assistance? Our team is here to help!
**Email:** [hello@nolano.ai](mailto:hello@nolano.ai)
We typically respond within 24 hours during business days.
# Supported Models
Source: https://nolanoinc.mintlify.app/models
Complete list of Time Series Foundation Models available through Nolano API
## Models with Covariates Support
These models can incorporate external variables (covariates) to improve forecasting accuracy.
| Model | Description | Use Case | Model ID | Paper |
| ------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------ |
| **Lagllama** | Foundation model from Mila Quebec | Best for general forecasting tasks, financial data, and scenarios where external variables significantly impact outcomes. Leverages transformer architecture for complex pattern recognition. | `forecast-model-1` | [Lag-Llama: Towards Foundation Models for Probabilistic Time Series Forecasting](https://arxiv.org/abs/2310.08278) |
## Models without Covariates
These models work with univariate time series data and are optimized for specific use cases.
| Model | Description | Use Case | Model ID | Paper |
| ---------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **chronos-bolt** | Amazon's lightweight Chronos model | Best for real-time forecasting and IoT sensor data requiring low latency predictions. Provides fast inference times with minimal computational overhead. | `forecast-model-2` | [Chronos: Learning the Language of Time Series](https://arxiv.org/abs/2403.07815) |
| **TiRex** | NXAI's model based on xLSTMs | Best for complex seasonal data and long-term forecasting with intricate cyclical patterns. Designed to capture complex temporal dependencies. | `forecast-model-3` | [TiRex: Zero-Shot Forecasting Across Long and Short Horizons with Enhanced In-Context Learning](https://arxiv.org/abs/2505.23719) |
| **TOTO** | Datadog's observability-optimized model | Best for DevOps monitoring, infrastructure metrics, and application performance data. Tailored for observability-related forecasting needs. | `forecast-model-4` | [TOTO: Time Series Optimized Transformer for Observability](https://arxiv.org/abs/2401.12345) |
More models coming soon!
## Model Performance
Each model is optimized for different scenarios:
* **TabPFN-TS**: Best overall performance for complex forecasting tasks
* **chronos-bolt**: Fastest inference times for real-time applications
* **TiRex**: Superior performance on seasonal and cyclical data
* **TOTO**: Optimized for observability and monitoring use cases
# Quickstart
Source: https://nolanoinc.mintlify.app/quickstart
Get started with Nolano time series forecasting API in under 5 minutes
## Getting Started with Nolano
Learn how to make your first forecast request and manage API keys.
### Get Your API Key
To use the Nolano API, you need a valid API key. You can create and manage your API keys from the [Nolano Dashboard](https://app.nolano.ai/dashboard/api-keys).
Your API key will look like:
```
ak_577aa2f186866ec0c75d1068bcff79cd3da4344b80aec1572e0fa07b364227d6
```
Test your API key with a simple request to ensure it's working correctly:
```bash theme={null}
curl -X GET "https://api.nolano.ai/verify" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json"
```
Make sure to include your API key in the `Authorization` header. The API uses
secure authentication to protect your data and ensure reliable access.
### Make Your First Forecast
Once your API key is validated, you can send time series data for forecasting.
Here's an example request with sample time series data:
```bash theme={null}
curl -X POST https://api.nolano.ai/forecast \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-H "X-Model-Selector: forecast-model-1" \
-d '{
"series": [
{
"timestamps": ["2023-01-01T00:00:00", "2023-01-02T00:00:00", "2023-01-03T00:00:00", "2023-01-04T00:00:00", "2023-01-05T00:00:00"],
"values": [10, 12, 15, 13, 16]
}
],
"forecast_horizon": 5,
"data_frequency": "Daily",
"forecast_frequency": "Daily",
"confidence": 0.95
}'
```
The API will respond with forecast predictions, confidence intervals, and metadata:
```json theme={null}
{
"forecast_timestamps": ["2023-01-06T00:00:00", "2023-01-07T00:00:00", "2023-01-08T00:00:00", "2023-01-09T00:00:00", "2023-01-10T00:00:00"],
"lower_bound": [14.5, 15.5, 16.5, 17.5, 18.5],
"median": [15.0, 16.0, 17.0, 18.0, 19.0],
"upper_bound": [15.5, 16.5, 17.5, 18.5, 19.5]
}
```
## Next Steps
Learn about all the parameters and options for the forecast endpoint.
Deep dive into API key authentication and security best practices.
# Python SDK
Source: https://nolanoinc.mintlify.app/sdk/python
Get started with the Nolano Python SDK for easy integration with the Nolano API
The Nolano Python SDK provides a simple and intuitive way to interact with the Nolano API from your Python applications.
Nolano Python SDK
v1.0.0
Simple and intuitive Python SDK for the Nolano API. Built for developers who want fast integration with powerful time series forecasting capabilities.
## Installation
Install the SDK using pip:
```bash theme={null}
pip install nolano
```
Or install directly from GitHub:
```bash theme={null}
pip install git+https://github.com/tejasvaidhyadev/nolano.git
```
## Quick Start
### Initialize the Client
```python theme={null}
from nolano import Nolano
client = Nolano(api_key="your-api-key-here")
```
### Basic Usage
```python theme={null}
from nolano import Nolano
import pandas as pd
# Initialize the client
client = Nolano(api_key="your_api_key_here")
# Or set environment variable: NOLANO_API_KEY=your_api_key_here
client = Nolano()
# Verify API key (recommended)
verification = client.verify_api_key()
if not verification['valid']:
print(f"API key issue: {verification['message']}")
exit(1)
print("✅ API key verified successfully!")
# Prepare your time series data
df = pd.DataFrame({
'date': pd.date_range(start='2023-01-01', periods=100, freq='D'),
'sales': [100, 102, 98, 105, 110, 108, 115, 120, 125, 130, 128, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, 300, 305, 310, 315, 320, 325, 330, 335, 340, 345, 350, 355, 360, 365, 370, 375, 380, 385, 390, 395, 400, 405, 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 460, 465, 470, 475, 480, 485, 490, 495, 500, 505, 510, 515, 520, 525, 530, 535, 540, 545, 550, 555, 560, 565, 570, 575]
})
# Generate forecast
forecast = client.forecast(
dataset=df,
target_col='sales',
timestamp_col='date',
forecast_horizon=30,
data_frequency='Daily'
)
print(f"Forecast: {forecast.median}")
print(f"Lower bound: {forecast.lower_bound}")
print(f"Upper bound: {forecast.upper_bound}")
```
## API Reference
### Constructor Parameters
```python theme={null}
class Nolano:
def __init__(
self,
api_key: str = None,
model_id: str = "forecast-model-1"
):
"""
Initialize the Nolano client.
Args:
api_key: Your Nolano API key (optional if NOLANO_API_KEY env var is set)
model_id: Default model to use for forecasting
"""
```
### Forecast Method
```python theme={null}
def forecast(
self,
dataset: pd.DataFrame,
target_col: str,
timestamp_col: str,
forecast_horizon: int,
data_frequency: str = "Daily",
forecast_frequency: str = None,
confidence: float = 0.95,
model_id: str = None
) -> NolanoForecast:
"""
Generate time series forecasts from a pandas DataFrame.
Args:
dataset: pandas DataFrame with time series data
target_col: Column name containing values to forecast
timestamp_col: Column name containing timestamps
forecast_horizon: Number of periods to forecast
data_frequency: Data frequency (Daily, Hourly, Weekly, etc.)
forecast_frequency: Forecast frequency (optional, defaults to data_frequency)
confidence: Confidence level for prediction intervals
model_id: Model to use (optional, uses default)
Returns:
NolanoForecast object with prediction data
"""
```
## Error Handling
The SDK provides helpful error messages for common issues:
```python theme={null}
# Verify API key before making requests
try:
result = client.verify_api_key()
if not result['valid']:
print(f"API key verification failed: {result['message']}")
# Handle invalid API key case
exit(1)
print("API key verified successfully!")
# Proceed with forecasting
forecast = client.forecast(
dataset=df,
target_col='sales',
timestamp_col='date',
forecast_horizon=30,
data_frequency='Daily'
)
except ValueError as e:
print(f"Parameter error: {e}")
except KeyError as e:
print(f"Column not found: {e}")
except Exception as e:
print(f"API error: {e}")
```
## Advanced Examples
### Using Different Models
```python theme={null}
# List available models
models = client.list_models()
for model in models:
print(model)
# Use a specific model
forecast = client.forecast(
dataset=df,
target_col='sales',
timestamp_col='date',
forecast_horizon=30,
data_frequency='Daily',
model_id='forecast-model-2' # Use alternative model
)
```
### Data Validation
```python theme={null}
# Validate your data before forecasting
validation = client.validate_data(
dataset=df,
target_col='sales',
timestamp_col='date'
)
if validation['valid']:
print("Data is valid!")
print(f"Stats: {validation['stats']}")
else:
print("Data issues found:")
for warning in validation['warnings']:
print(f"- {warning}")
```
### Working with Forecast Results
```python theme={null}
# Access forecast data
forecast.forecast_timestamps # List of forecast timestamp strings
forecast.median # List of median forecast values
forecast.lower_bound # List of lower confidence bound values
forecast.upper_bound # List of upper confidence bound values
# Convert to DataFrame
df = forecast.to_dataframe()
# Evaluate forecast accuracy
actual_values = [105, 110, 108, 115, 120] # Actual values for forecast period
metrics = forecast.evaluate(actual_values)
print(f"MAE: {metrics['mae']:.2f}")
print(f"WAPE: {metrics['wape']:.2f}%")
```
## Supported Frequencies
The Nolano API supports the following time series frequencies:
* `Seconds` - Second-level data
* `Minutes` - Minute-level data
* `Hours` - Hourly data
* `Daily` - Daily data
* `Weekly` - Weekly data
* `Monthly` - Monthly data
* `Quarterly` - Quarterly data
* `Yearly` - Annual data
## Environment Variables
For production applications, use environment variables:
```python theme={null}
import os
# Set your API key
export NOLANO_API_KEY=your_api_key_here
# In your code
client = Nolano() # Will automatically use NOLANO_API_KEY environment variable
```
## Examples
Check out the examples directory in the [GitHub repository](https://github.com/tejasvaidhyadev/nolano) for complete usage examples:
* `examples/verify_api_key.py` - Quick API key verification script
* `examples/nolano_example.py` - Comprehensive usage examples with API verification
* `examples/nolano-forecasting-example.ipynb` - Jupyter notebook tutorial
### Quick API Key Test
To quickly verify your API key is working:
```python theme={null}
from nolano import Nolano
client = Nolano()
result = client.verify_api_key()
if result['valid']:
print("✅ API key is valid!")
else:
print(f"❌ Issue: {result['message']}")
```
## Next Steps
* Visit the [GitHub repository](https://github.com/tejasvaidhyadev/nolano) for the latest updates and examples
* Explore the [API Reference](/api-reference/introduction) for detailed endpoint documentation
* Get support by opening an issue on [GitHub](https://github.com/tejasvaidhyadev/nolano/issues) or contacting [hello@nolano.ai](mailto:hello@nolano.ai)