Flickr.Net 0.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Flickr.Net --version 0.4.0
                    
NuGet\Install-Package Flickr.Net -Version 0.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Flickr.Net" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Flickr.Net" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Flickr.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Flickr.Net --version 0.4.0
                    
#r "nuget: Flickr.Net, 0.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Flickr.Net@0.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Flickr.Net&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Flickr.Net&version=0.4.0
                    
Install as a Cake Tool

Flickr.Net

CI NuGet NuGet Downloads License: Apache-2.0

A modern .NET 10 client library for the Flickr API with dependency injection, IHttpClientFactory integration, and optional HybridCache support.

Installation

dotnet add package Flickr.Net

Quick Start

// Program.cs
services.AddFlickr(o =>
{
    o.ApiKey = "your-api-key";
    o.SharedSecret = "your-shared-secret";
});

// Optional: enable response caching
services.AddFlickrCaching();
// Inject IFlickrClient anywhere
public class PhotoService(IFlickrClient flickr)
{
    public async Task<Photo> GetPhotoAsync(string id, CancellationToken ct)
    {
        return await flickr.Photos.GetInfoAsync(id, ct);
    }
}

Without DI

using var flickr = new FlickrClient("your-api-key", "your-shared-secret");

API Areas

IFlickrClient organizes the Flickr API into sub-clients:

flickr.Photos          // Search, get info, manage photos
flickr.Photosets        // Albums / photosets
flickr.People           // User profiles, find by email/username
flickr.Favorites        // Add, remove, list favorites
flickr.Groups           // Browse and manage groups
flickr.GroupsPools       // Group photo pools
flickr.Tags             // Tag management and search
flickr.Galleries        // Gallery operations
flickr.Contacts         // Contact management
flickr.Upload           // Upload and replace photos
flickr.OAuth            // OAuth 1.0a authentication flow
flickr.Stats            // View counts and referrers
flickr.PhotosComments   // Photo comments
flickr.PhotosGeo        // Geolocation data
flickr.PhotosNotes      // Photo annotations
flickr.Interestingness  // Interesting photos
flickr.MachineTags      // Machine tag operations
// ... and 20+ more

Authentication

// 1. Get a request token
var requestToken = await flickr.OAuth.GetRequestTokenAsync("https://your-callback-url");

// 2. Send user to Flickr authorization page
var authUrl = $"https://www.flickr.com/services/oauth/authorize?oauth_token={requestToken.Token}";

// 3. After user authorizes, exchange for access token
var accessToken = await flickr.OAuth.GetAccessTokenAsync(requestToken, "verifier-code");

// 4. Store and set the tokens for future requests
flickr.FlickrSettings.OAuthAccessToken = accessToken.Token;
flickr.FlickrSettings.OAuthAccessTokenSecret = accessToken.TokenSecret;

Search Photos

var options = new PhotoSearchOptions
{
    Text = "sunset",
    Tags = "nature,landscape",
    PerPage = 20,
    Extras = PhotoSearchExtras.DateTaken | PhotoSearchExtras.Description
};

var photos = await flickr.Photos.SearchAsync(options);

Upload Photos

await using var stream = File.OpenRead("photo.jpg");
var photoId = await flickr.Upload.UploadPictureAsync(
    stream,
    "photo.jpg",
    title: "Sunset at the beach",
    tags: "sunset beach vacation",
    isPublic: true);

Caching

Response caching is opt-in via HybridCache:

// Basic in-memory caching
services.AddFlickrCaching();

// With custom expiration
services.AddFlickrCaching(o =>
{
    o.DefaultEntryOptions = new() { Expiration = TimeSpan.FromMinutes(10) };
});

// With distributed L2 cache (e.g. Redis)
services.AddFlickrCaching();
services.AddStackExchangeRedisCache(o => o.Configuration = "localhost:6379");

Without AddFlickrCaching(), every API call goes directly to Flickr — no caching overhead.

Default Search Extras

Configure extras that are automatically included in every search:

services.AddFlickr(o =>
{
    o.ApiKey = "...";
    o.DefaultSearchExtras = PhotoSearchExtras.Description | PhotoSearchExtras.DateTaken;
});

Migration

Upgrading from v0.3.x? See the Migration Guide.

Requirements

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgments

  • Original FlickrNet library by Sam Judson
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 49 9/24/2026
0.4.0 50 9/23/2026
0.3.6 49 9/2/2026
0.3.5 48 8/16/2026
0.3.4 48 8/14/2026
0.3.3 68 5/2/2026
0.3.2 61 5/1/2026
0.3.1 57 5/1/2026
0.3.0 468 11/23/2023
0.2.1 280 11/23/2023
0.2.0 287 11/23/2023