DeviantArtFs 0.5.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DeviantArtFs --version 0.5.0
NuGet\Install-Package DeviantArtFs -Version 0.5.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="DeviantArtFs" Version="0.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeviantArtFs --version 0.5.0
#r "nuget: DeviantArtFs, 0.5.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.
// Install DeviantArtFs as a Cake Addin
#addin nuget:?package=DeviantArtFs&version=0.5.0

// Install DeviantArtFs as a Cake Tool
#tool nuget:?package=DeviantArtFs&version=0.5.0

DeviantArtFs

A .NET / F# library to interact with the DeviantArt / Sta.sh API.

If you're using this library in a .NET Framework project and it doesn't run, make sure that the dependicies (FSharp.Core, FSharp.Data, FSharp.Control.AsyncSeq) are installed.

Currently unsupported features

  • The following groups of endpoints are not currently implemented:
    • Comments
    • Feed
    • Messages
    • Notes
  • The "expand" parameter (user.details, user.geo, etc) is not currently supported.
  • The "ext_preload" parameter (gallery/folders, collections/folders) is not currently supported.
  • The "mature_content" parameter is not currently supported.

Supported endpoints

Browse

  • GET /browse/categorytree
  • GET browse/dailydeviations
  • GET browse/hot
  • GET browse/morelikethis
  • GET browse/morelikethis/preview
  • GET browse/newest
  • GET browse/popular
  • GET browse/tags
  • GET browse/tags/search
  • GET browse/undiscovered
  • GET browse/user/journals

Collections

  • GET /collections/{folderid}
  • GET /collections/folders
  • POST /collections/fave
  • POST /collections/unfave
  • POST /collections/folders/create
  • GET /collections/folders/remove/{folderid}

Data

  • GET /data/countries
  • GET /data/privacy
  • GET /data/submission
  • GET /data/tos

Deviation

  • GET /deviation/{deviationid}
  • GET /deviation/content
  • GET /deviation/download/{deviationid}
  • GET /deviation/embeddedcontent
  • GET /deviation/metadata
  • GET /deviation/whofaved
  • GET /gallery/gallery/{folderid}
  • GET /gallery/all
  • GET /gallery/folders
  • POST /gallery/folders/create
  • GET /gallery/folders/remove/{folderid}

Stash

  • GET /stash/{stackid}
  • GET /stash/{stackid}/contents
  • POST /stash/delete
  • GET /stash/delta
  • GET /stash/item/{itemid}
  • POST /stash/move/{stackid}
  • POST /stash/position/{stackid}
  • POST /stash/publish
  • GET /stash/publish/categorytree
  • GET /stash/publish/userdata
  • GET /stash/space
  • POST /stash/submit
  • POST /stash/update/{stackid}

The DeviantArt.Stash.Marshal library provides a StashRoot object that can process delta entries.

User

  • GET /user/damntoken
  • GET /user/friends/{username}
  • GET /user/friends/search
  • GET /user/friends/unwatch/{username}
  • POST /user/friends/watch/{username}
  • GET /user/friends/watching/{username}
  • GET /user/profile/{username}
  • POST /user/profile/update
  • GET /user/statuses
  • GET /user/statuses/{statusid}
  • POST /user/statuses/post
  • GET /user/watchers/{username}
  • GET /user/whoami
  • POST /user/whois

Util

  • GET /placebo

Usage

Each request you can make has a module (static class) in one of the DeviantArtFs.Requests namespaces, with AsyncExecute and ExecuteAsync methods. AsyncExecute returns an F# asynchronous workflow, while ExecuteAsync returns a Task<T>.

The methods sometimes vary in their response objects as well; AsyncExecute will typically return a record or JsonProvider type that uses option types to represent fields that may or may not exist, while ExecuteAsync will return a class or interface that uses nullable reference types (or Nullable<T>) for such fields.

Example (C#):

var list = new List<DeviantArtFs.Interop.Deviation>();
int offset = 0;
while (true) {
	var req = new DeviantArtFs.PagingParams {
		Offset = offset,
		Limit = 24
	};
    DeviantArtFs.IDeviantArtPagedResult<DeviantArtFs.Interop.Deviation> resp =
        await DeviantArtFs.Requests.Gallery.GalleryAllView.ExecuteAsync(token, req, new DeviantArtFs.Requests.Gallery.GalleryAllViewRequest());
	list.AddRange(resp.Results);
	offset = resp.NextOffset ?? 0;
	if (!resp.HasMore) break;
}

Example (F#):

let list = new ResizeArray<DeviantArtFs.DeviationResponse.Root>()
let mutable offset = 0
let mutable more = true
while more do
    let req = new DeviantArtFs.Requests.Gallery.GalleryAllViewRequest()
    let paging = new PagingParams(Offset = 0, Limit = Nullable 24)
    let! (resp: DeviantArtPagedResult<DeviationResponse.Root>) = DeviantArtFs.Requests.Gallery.GalleryAllView.AsyncExecute token paging req
    list.AddRange(resp.Results)
    offset <- resp.NextOffset |> Option.defaultValue 0
    more <- resp.HasMore

Note how the result from AsyncExecute is DeviantArtPagedResult, which has a NextOffset field of int option, while the result from ExecuteAsync is IDeviantArtPagedResult, which has a NextOffset field of int?.

See ENDPOINTS.md for more information.

Authentication

See also: https://www.deviantart.com/developers/authentication

Both Authorization Code (recommended) and Implicit grant types are supported. If you are writing a Windows desktop application, you can use the forms in the DeviantArtFs.WinForms package to get a code or token from the user.

The DeviantArtAuth class provides methods to support the Authorization Code grant type (getting tokens from an authorization code and refreshing tokens).

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DeviantArtFs:

Package Downloads
DeviantArtFs.Stash.Marshal

An F#/.NET library to interact with the Sta.sh API and manage state (.NET Standard 2.0)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.1.0-rc1 184 11/27/2023
9.0.0 234 11/22/2023
9.0.0-beta4 115 5/30/2023
9.0.0-beta2 89 5/28/2023
8.0.0 435 5/30/2021
8.0.0-beta4 255 5/30/2021
8.0.0-beta3 304 5/30/2021
8.0.0-beta2 214 5/30/2021
7.0.1 378 1/11/2021
7.0.0 354 1/9/2021
7.0.0-beta1 268 1/9/2021
6.0.2 341 1/5/2021
6.0.1 400 12/28/2020
6.0.0 314 12/27/2020
6.0.0-beta2 300 12/26/2020
6.0.0-beta1 295 12/26/2020
5.0.0 488 2/11/2020
5.0.0-beta1 411 2/11/2020
4.0.0 480 1/23/2020
4.0.0-beta2 425 1/23/2020
4.0.0-beta1 435 1/22/2020
3.0.0 527 1/17/2020
2.2.0 530 1/6/2020
2.1.0 505 9/9/2019
2.0.0-beta3 480 3/9/2019
2.0.0-beta2 476 3/8/2019
2.0.0-beta1 455 3/6/2019
1.1.0-beta1 447 3/5/2019
1.0.0 669 2/10/2019
0.9.0 1,307 1/29/2019
0.8.0 658 1/28/2019
0.7.3 690 1/22/2019
0.7.2 668 1/22/2019
0.7.1 1,316 1/19/2019
0.7.0 700 1/18/2019
0.6.0 1,341 1/14/2019
0.5.0 1,324 1/11/2019
0.4.0 1,327 1/3/2019
0.3.0 1,339 12/31/2018
0.2.0-alpha 1,138 12/27/2018
0.1.0-alpha 591 12/21/2018

0.5.0: Implemented Collections, added AsyncSeq support, other changes