Getting Started¶
Get up and running with the Open To Close API Python client in just a few minutes. This section covers everything you need to start making API calls successfully.
🚀 Quick Navigation¶
-
Installation
Install the Python client library and verify your setup
-
Authentication
Configure your API key and environment setup
-
Quick Start
Make your first API call in under 5 minutes
-
Configuration
Advanced client configuration and environment options
📋 Prerequisites¶
Before getting started, ensure you have:
System Requirements
📋 Python Version: Python 3.8 or higher
Package Manager: pip (included with Python)
API Access: Valid Open To Close API key
Development Environment
While not required, we recommend using:
- Virtual environment (
venv
orconda
) - Code editor with Python support (VS Code, PyCharm, etc.)
- Git for version control
⚡ Quick Setup Path¶
For experienced developers who want to get started immediately:
🎯 Learning Path¶
Beginner Path¶
New to the Open To Close API or Python API clients:
- Installation - Set up your environment step by step
- Authentication - Learn about API keys and security
- Quick Start - Guided tutorial with explanations
- Explore API Documentation - Understand all available options
Experienced Path¶
Familiar with API clients and Python development:
- Quick Start - Jump straight to making API calls
- API Reference - Explore available operations
- API Reference - Explore all available methods
🔧 Common Setup Scenarios¶
Development Environment¶
# Development setup with verbose logging
import logging
from open_to_close import OpenToCloseAPI
# Enable debug logging
logging.basicConfig(level=logging.DEBUG)
# Initialize with explicit configuration
client = OpenToCloseAPI(
api_key="your_development_key",
base_url="https://api.opentoclose.com/v1" # Production URL
)
Production Environment¶
# Production setup with environment variables
import os
from open_to_close import OpenToCloseAPI
# Verify environment is properly configured
if not os.getenv("OPEN_TO_CLOSE_API_KEY"):
raise EnvironmentError("API key not found in environment")
# Initialize for production
client = OpenToCloseAPI() # Uses environment variables
Testing Environment¶
# Testing setup with mock responses
from open_to_close import OpenToCloseAPI
import responses
# Mock API responses for testing
@responses.activate
def test_api_client():
responses.add(
responses.GET,
"https://api.opentoclose.com/v1/properties",
json={"results": []},
status=200
)
client = OpenToCloseAPI(api_key="test_key")
properties = client.properties.list_properties()
assert properties == []
🆘 Troubleshooting¶
Common Issues¶
Authentication Errors
If you're getting authentication errors:
- Verify your API key is correct
- Check that the environment variable is set properly
- Ensure there are no extra spaces or characters
- Try regenerating your API key
Import Errors
If the import fails:
- Verify the package is installed:
pip list | grep open-to-close
- Check you're using the correct virtual environment
- Try reinstalling:
pip install --upgrade open-to-close
Connection Issues
If you can't connect to the API:
- Check your internet connection
- Verify the base URL is correct
- Check if there are any firewall restrictions
Getting Help¶
- Guides - Usage patterns and examples
- GitHub Issues - Report bugs or request features
🚀 Next Steps¶
Once you've completed the setup:
- Explore the API Reference - See all available methods
- Explore Guides - Usage patterns and examples
- Review Properties API - Complete property management