Getting started overview
Getting started with Time Door involves a sequence of steps designed to enable developers to quickly integrate its time series forecasting and anomaly detection capabilities. The process generally begins with account creation, followed by the acquisition of API credentials. Developers can then utilize the Time Door API directly or leverage the provided Python SDK for Time Door to interact with the service. This quickstart guide focuses on the initial configuration and the execution of a foundational API request to generate a forecast.
The Time Door platform is designed to support various use cases, including demand forecasting and resource planning, by processing historical data and generating predictions. Integration typically involves:
- Signing up for a Time Door account, potentially utilizing the free Developer Plan.
- Generating and securing API keys for authentication.
- Setting up a new project within the Time Door Console or programmatically.
- Uploading or ingesting time series data.
- Making an initial API call to train a model or request a forecast.
This guide will walk through these essential steps, providing a practical path to making your first successful interaction with Time Door.
Quick Reference: Time Door Getting Started
| Step | What to Do | Where |
|---|---|---|
| 1. Sign Up | Create a new Time Door account. | Time Door Signup Page |
| 2. Get API Keys | Generate and copy your API key from your account dashboard. | Time Door Console API Keys |
| 3. Install SDK (Optional) | Install the Time Door Python SDK. | pip install timedoor-sdk (Python SDK documentation) |
| 4. Create Project | Set up a new project to organize your data and models. | Time Door Console or API |
| 5. Prepare Data | Format your time series data (e.g., CSV with timestamp and value). | Time Door Data Formats Guide |
| 6. Make First Request | Send a basic API request to upload data or create a forecast. | Time Door API Reference / Python SDK Forecasting Example |
Create an account and get keys
To begin using Time Door, you must first create an account. This process provides access to the Time Door Console, where you manage projects, data, and retrieve your API credentials. Time Door offers a Developer Plan that includes 500 API calls per month and support for one project, suitable for initial exploration and development.
Account Creation Steps
- Navigate to the Time Door signup page.
- Provide the required information, typically an email address and a password.
- Verify your email address, if prompted, by following the instructions sent to your inbox.
- Once registered, log in to the Time Door Console.
Retrieving API Keys
After logging into the console, your API keys are essential for authenticating requests to the Time Door API. API keys serve as a form of authentication token, allowing the Time Door service to verify your identity and authorize your API calls. It's important to keep these keys secure to prevent unauthorized access to your account and data, as recommended by general API key security best practices.
- From the Time Door Console dashboard, locate the "API Keys" or "Settings" section. The exact path may vary based on UI updates, but typically it is found under a user profile or project settings menu.
- Generate a new API key if one does not already exist. It's common practice to generate separate keys for different environments (e.g., development, staging, production) or projects for better access control.
- Copy your API key immediately. For security reasons, API keys are often only displayed once upon generation and cannot be retrieved later. If lost, a new key must be generated.
- Store your API key securely. Avoid hardcoding it directly into your application code. Instead, use environment variables or a secure configuration management system.
For detailed instructions, refer to the official Time Door authentication documentation.
Your first request
This section outlines how to make your first API request to Time Door using the Python SDK. This approach is recommended for Python developers due to its simplified interface for common tasks like data ingestion and forecasting. If you prefer direct API calls, the Time Door API Reference provides examples for various endpoints.
Prerequisites
- A Time Door account with an active API key.
- Python 3.7+ installed on your system.
- The Time Door Python SDK installed:
pip install timedoor-sdk
Example: Uploading Data and Requesting a Forecast
For your first request, we'll simulate uploading a simple time series dataset and then requesting a forecast. Time Door expects data in a structured format, typically a CSV-like structure with a timestamp column and one or more value columns. For this example, we'll use a minimalist dataset.
Step 1: Prepare your data
Create a file named sample_data.csv with the following content. This represents daily sales data.
"timestamp","sales"
"2023-01-01T00:00:00Z",100
"2023-01-02T00:00:00Z",105
"2023-01-03T00:00:00Z",102
"2023-01-04T00:00:00Z",110
"2023-01-05T00:00:00Z",108
"2023-01-06T00:00:00Z",115
"2023-01-07T00:00:00Z",112
Ensure your timestamps adhere to ISO 8601 format, as specified in the Time Door data format guidelines.
Step 2: Write the Python code
Create a Python file (e.g., first_forecast.py) and add the following code. Replace YOUR_API_KEY with the actual API key you retrieved from the Time Door Console.
import os
from timedoor_sdk import TimeDoorClient
from datetime import datetime
# Retrieve API key from environment variable for security
# Alternatively, replace os.environ.get with your key string for quick testing
API_KEY = os.environ.get("TIMEDOOR_API_KEY", "YOUR_API_KEY")
PROJECT_ID = "your-project-id" # Replace with your Time Door Project ID
client = TimeDoorClient(api_key=API_KEY)
def run_first_forecast():
try:
# Ensure the project exists in the Time Door Console or create it via API
# For this example, assume PROJECT_ID exists from console setup.
print(f"Using Project ID: {PROJECT_ID}")
# 1. Upload data
print("Uploading sample_data.csv...")
upload_response = client.data.upload(
project_id=PROJECT_ID,
file_path="sample_data.csv",
dataset_name="my_first_dataset",
timestamp_column="timestamp",
value_columns=["sales"]
)
dataset_id = upload_response["dataset_id"]
print(f"Data uploaded successfully. Dataset ID: {dataset_id}")
# 2. Request a forecast
print("Requesting forecast...")
forecast_response = client.forecast.create(
project_id=PROJECT_ID,
dataset_id=dataset_id,
forecast_horizon=3, # Forecast 3 periods into the future
forecast_unit="day", # Based on our daily data
target_column="sales"
)
forecast_id = forecast_response["forecast_id"]
print(f"Forecast request submitted. Forecast ID: {forecast_id}")
# 3. Retrieve forecast results (asynchronous process)
# Time Door processes forecasts asynchronously. You might need to poll.
print("Waiting for forecast results. This may take a moment...")
forecast_results = client.forecast.get_results(
project_id=PROJECT_ID,
forecast_id=forecast_id,
wait_for_completion=True, # Blocks until forecast is ready
timeout=300 # Max wait time in seconds
)
print("Forecast results received:")
for item in forecast_results["predictions"]:
print(f" Timestamp: {item['timestamp']}, Predicted Sales: {item['predicted_value']:.2f}")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
run_first_forecast()
Step 3: Run the code
Execute your Python script from your terminal:
python first_forecast.py
Upon successful execution, the script will upload your data, initiate a forecast, and then print the predicted sales values for the next three days.
Common next steps
After successfully making your first forecast request, consider these common next steps to further integrate Time Door into your development workflow:
- Explore the Console: Familiarize yourself with the Time Door Console. It provides a visual interface for managing projects, datasets, monitoring model performance, and reviewing past forecasts.
- Advanced Data Ingestion: Learn about more sophisticated data ingestion methods, including streaming data or integrating with existing data pipelines. The Time Door data ingestion documentation covers various options.
- Model Customization: Time Door allows for some level of model configuration. Investigate parameters for training, feature engineering, and hyperparameter tuning to optimize forecast accuracy for your specific datasets and use cases. Refer to the modeling guide for details.
- Error Handling and Monitoring: Implement robust error handling in your application to manage API rate limits, invalid requests, or service interruptions. Set up monitoring and alerting for your Time Door integrations to ensure continuous operation and data quality.
- Security Best Practices: Continue to follow security best practices for API keys and tokens, such as rotating keys regularly and restricting access permissions.
- Explore Additional Features: Time Door supports anomaly detection and other time series analysis features beyond basic forecasting. Review the full Time Door documentation to uncover these capabilities.
- Integrate with CI/CD: Automate the deployment and testing of your Time Door integrations within your continuous integration/continuous delivery (CI/CD) pipelines to maintain consistency and reliability.
Troubleshooting the first call
When encountering issues with your first Time Door API call, consider the following common troubleshooting steps:
- API Key Validity: Double-check that your API key is correct and has not expired or been revoked. Ensure there are no leading or trailing spaces if copied manually. Refer to the authentication section in the documentation.
- Project ID: Verify that the
PROJECT_IDin your code matches an existing project in your Time Door Console. Projects organize your datasets and models. - Network Connectivity: Confirm that your environment has internet access and can reach the Time Door API endpoints. Proxy settings or firewalls can sometimes block outgoing requests.
- Data Format: The most common issue is incorrectly formatted input data. Ensure your
sample_data.csv(or actual data) strictly adheres to the Time Door data format specifications, especially for timestamp column names and format (ISO 8601). - SDK Version: Ensure you are using the latest version of the Time Door Python SDK. Outdated SDKs might have compatibility issues or missing features. Upgrade using
pip install --upgrade timedoor-sdk. - Error Messages: Carefully read any error messages returned by the API or the SDK. They often provide specific clues about what went wrong (e.g., "Invalid API Key," "Dataset Not Found," "Bad Request: Invalid timestamp format"). The API reference includes common error codes and their meanings.
- Environment Variables: If you're using environment variables to store your API key (recommended), ensure they are correctly set and accessible to your script. For example, on Linux/macOS:
export TIMEDOOR_API_KEY="YOUR_API_KEY"before running the script. - Resource Limits: If you are on the free Developer Plan, check if you have exceeded the 500 API calls/month or the one-project limit. The console should provide usage statistics.
- Timeouts: For long-running operations like forecast generation, ensure your client or network configuration doesn't time out prematurely. The
wait_for_completionparameter in the SDK can handle polling, but network-level timeouts may still occur. - Time Door Support: If you've exhausted these steps, consult the Time Door support resources or community forums for further assistance.