NextcloudApi 1.0.4

.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
Install-Package NextcloudApi -Version 1.0.4
dotnet add package NextcloudApi --version 1.0.4
<PackageReference Include="NextcloudApi" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NextcloudApi --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NextcloudApi, 1.0.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install NextcloudApi as a Cake Addin
#addin nuget:?package=NextcloudApi&version=1.0.4

// Install NextcloudApi as a Cake Tool
#tool nuget:?package=NextcloudApi&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


This is a C# wrapper to (the most important bits of) the Nextcloud API.

It is provided with a Visual Studio 2019 build solution for .NET Standard, so can be used with any version of .NET.

There is a test project (for net core only) which also demonstrates usage.

Setup before using the API

In order to use the Nextcloud API you need to supply an Api Username and Password. Some calls can be made using OAuth2, instead of providing a Username and Password in Settings, but any calls that insist on a recent password login (like most of the admin ones) will not work with OAuth2.

This information has to be provided in an object that implements the ISettings interface, which is then used to create a NextcloudApi instance. A Settings class which implements this interface is provided, to save you work. This provides a static Load method, reads the settings from LocalApplicationData/NextcloudApi/Settings.json. On a Windows 10 machine, LocalApplicationData is C:\Users\<USER>\AppData\Local, on Linux it is ~user/.local/share.


In order to run the Unit Tests provided, you must provide additional data in your ISettings object - see the Settings object in UnitTest1.cs.

Hooks for more complex uses

You do not have to use the provided Settings class, provided you have a class that implements ISettings.


This wrapper is licensed under creative commons share-alike, see license.txt.

Using the Api

The Unit Tests should give you sufficient examples on using the Api.

An Api instance is created by passing it an object that implements ISettings (a default class is provided which will read the settings from a json file). The Api instance is IDisposable, so should be Disposed when no longer needed (this is because it contains an HttpClient).

C# classes are provided for the objects you can send to or receive from the Nextcloud api. For instance the Group object represents groups. These main objects have methods which call the Nextcloud api - such as Group.Create to create a new group, Group.Get to get group details, etc.

Some Api calls return a list of items (such as Group.List). These are returned as a subclass of ApiList<Group>. The Nextcloud api itself usually only returns the first few items in the list, and needs to be called again to return the next chunk of items. This is all done for you by ApiList - it has a method called All(Api) which will return an IEnumerable of the appropriate listed object. Enumerating the enumerable will return all the items in the first chunk, then call the Nextcloud api to get the next chunk, return them and so on. It hides all that work from the caller, while remaining as efficient as possible by only getting data when needed - for instance, using Linq calls like Any or First will stop getting data when the first item that matches the selection function is found.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
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
1.0.17 1,892 4/27/2021
1.0.16 133 4/27/2021
1.0.15 638 8/21/2020
1.0.14 711 2/20/2020
1.0.12 344 2/7/2020
1.0.11 291 2/5/2020
1.0.9 430 12/6/2019
1.0.8 312 12/4/2019
1.0.7 371 10/1/2019
1.0.6 301 9/23/2019
1.0.5 305 9/5/2019
1.0.4 303 9/5/2019
1.0.3 323 8/30/2019
1.0.2 354 8/22/2019
1.0.1 324 8/15/2019
1.0.0 363 8/9/2019

Fix bug in list retrieval