TimeGPT is a production ready, generative pretrained transformer for time series. It's capable of accurately predicting various domains such as retail, electricity, finance, and IoT with just a few lines of code 🚀.
QuickstartTGPT.mp4
pip install nixtla>=0.8.0import pandas as pd
from nixtla import NixtlaClient# Obtain an API key via https://nixtla.io/free-trial
# 1. Instantiate the NixtlaClient
nixtla_client = NixtlaClient(api_key = 'YOUR API KEY HERE')
# 2. Read historic electricity demand data
df = pd.read_csv('https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv')
# 3. Forecast the next 24 hours
fcst_df = nixtla_client.forecast(df, h=24, level=[80, 90])
# 4. Plot your results (optional)
nixtla_client.plot(df, fcst_df, level=[80, 90])Warning
detect_anomalies() performs historical (batch) detection and is removed in
nixtla 1.0, where the name will refer to online anomaly detection instead.
There is no drop-in replacement — use detect_anomalies_online(), which
requires h and detection_size. See the CHANGELOG for
details.
# Obtain an API key via https://nixtla.io/free-trial
# 1. Instantiate the NixtlaClient
nixtla_client = NixtlaClient(api_key = 'YOUR API KEY HERE')
# 2. Read Data # Wikipedia visits of NFL Star (
df = pd.read_csv('https://datasets-nixtla.s3.amazonaws.com/peyton-manning.csv')
# 3. Detect Anomalies
anomalies_df = nixtla_client.detect_anomalies(df, time_col='timestamp', target_col='value', freq='D')
# 4. Plot your results (optional)
nixtla_client.plot(df, anomalies_df,time_col='timestamp', target_col='value')Explore our API Reference to discover how to leverage TimeGPT across various programming languages including JavaScript, Go, and more.

