Unsplasharp Documentation
A modern, asynchronous, and feature-rich .NET library for the Unsplash API. This comprehensive documentation will help you get started quickly and make the most of Unsplasharp's powerful features.
🚀 Quick Start
New to Unsplasharp? Start here:
- Getting Started Guide - Complete setup guide with examples
 - API Key Setup - How to get your Unsplash API credentials
 - Basic Examples - Simple code examples to get you started
 
📚 Core Documentation
Essential Guides
- Getting Started - Comprehensive setup and first steps
 - API Reference - Complete method documentation with examples
 - Model Reference - Detailed model class documentation
 - Error Handling - Comprehensive error handling strategies
 
Advanced Topics
- Advanced Usage Patterns - Pagination, filtering, and optimization
 - Code Examples & Recipes - Practical examples for common scenarios
 - Testing & Best Practices - Testing strategies and production tips
 - Migration Guide - Upgrading from older versions
 
Integration & Configuration
- IHttpClientFactory Integration - Modern HTTP client management
 - Logging Configuration - Structured logging setup
 - Downloading Photos - Image download examples
 
Navigation & Reference
- Quick Reference - Fast reference for common operations
 - Navigation Guide - Find what you need quickly
 - Table of Contents - Complete documentation overview
 
🎯 Quick Navigation
By Use Case
| I want to... | Go to | 
|---|---|
| Get started quickly | Getting Started Guide | 
| Search for photos | Search Examples | 
| Handle errors properly | Error Handling Guide | 
| Download images | Download Examples | 
| Build a web app | Web Integration | 
| Test my code | Testing Guide | 
| Optimize performance | Advanced Patterns | 
| Migrate from older version | Migration Guide | 
By Experience Level
| Level | Recommended Reading | 
|---|---|
| Beginner | Getting Started → Basic Examples → Error Handling | 
| Intermediate | API Reference → Advanced Patterns → Model Reference | 
| Advanced | Testing Guide → Performance Optimization → Migration Guide | 
🔧 API Overview
Unsplasharp provides access to all major Unsplash API endpoints:
Core Features
- Photos: Get random photos, search, retrieve by ID
 - Collections: Browse curated collections
 - Users: Access photographer profiles and portfolios
 - Search: Powerful search with filters and pagination
 - Statistics: Platform usage statistics
 
Modern .NET Features
- Async/Await: Full async support with cancellation tokens
 - Exception Handling: Specific exception types with rich context
 - Dependency Injection: Built-in DI container support
 - IHttpClientFactory: Proper HTTP client lifecycle management
 - Structured Logging: Microsoft.Extensions.Logging integration
 - Performance: Connection pooling and intelligent caching
 
🎨 Code Examples
Quick Example
using Unsplasharp;
// Create client
var client = new UnsplasharpClient("YOUR_APPLICATION_ID");
// Get a random photo
try
{
    var photo = await client.GetRandomPhotoAsync();
    Console.WriteLine($"Photo by {photo.User.Name}: {photo.Urls.Regular}");
}
catch (UnsplasharpException ex)
{
    Console.WriteLine($"Error: {ex.Message}");
}
Search Photos
// Search with filters
var photos = await client.SearchPhotosAsync(
    query: "mountain landscape",
    orientation: Orientation.Landscape,
    color: "blue",
    perPage: 20
);
foreach (var photo in photos)
{
    Console.WriteLine($"{photo.Description} by {photo.User.Name}");
}
More examples: Code Examples & Recipes
🛠️ Installation
Package Manager Console
Install-Package Unsplasharp
.NET CLI
dotnet add package Unsplasharp
PackageReference
<PackageReference Include="Unsplasharp" Version="*" />
🔗 External Resources
- Unsplash API Documentation - Official API docs
 - Unsplash Developer Guidelines - API usage guidelines
 - GitHub Repository - Source code and issues
 - NuGet Package - Package downloads
 
💡 Need Help?
- Getting Started Issues: Check the Getting Started Guide
 - API Questions: See the API Reference
 - Error Handling: Review Error Handling Guide
 - Performance Issues: Read Advanced Usage Patterns
 - Bug Reports: Use GitHub Issues
 
📝 Contributing
Unsplasharp is an open-source project. Contributions are welcome! Please see the contribution guidelines for more information.
Ready to get started? → Getting Started Guide