PinSharp 2.2.6
See the version list below for details.
dotnet add package PinSharp --version 2.2.6
NuGet\Install-Package PinSharp -Version 2.2.6
<PackageReference Include="PinSharp" Version="2.2.6" />
paket add PinSharp --version 2.2.6
#r "nuget: PinSharp, 2.2.6"
// Install PinSharp as a Cake Addin #addin nuget:?package=PinSharp&version=2.2.6 // Install PinSharp as a Cake Tool #tool nuget:?package=PinSharp&version=2.2.6
An async C# wrapper library for the Pinterest API.
Notice
I'm not maintaining this regularly as I don't use it that much. If you have any issues or request please create a new issue and I'll have a look.
Overview
New in version 2.0
A lot of the changes are code cleanup and refactoring, but there is a few new features.
Rate limit information
Information about rate limits are now stored on the PinSharpClient
in the property RateLimits
It contains information about the request limit and remaining requests and when this information was last updated (i.e. the time of your last request through this client).
Exceptions
The client now throws its own exceptions all extending from PinSharpException
.
For example a PinSharpRateLimitExceededException
will be thrown if the rate limit has been exceeded.
Breaking changes in version 2.0
All return types have generally been changed from a concrete class to an interface, e.g. Pin
to IPin
.
BoardDetails
and UserDetails
have also been renamed in the process to IDetailedBoard
and IDetailedUsers
.
Renamed
PinterestClient
renamed toPinSharpClient
PinterestAuthClient
renamed toPinSharpAuthClient
PinterestApi
madeinternal
Scopes.WriteRelationShips
renamed toScopes.WriteRelationsships
Moved
PinSharp.IHttpClient
moved toPinSharp.Http.IHttpClient
PinSharp.Models.ImageInfo
moved toPinSharp.Models.Images.ImageInfo
Refactored/combined
- Models
BoardDetails
removed - merged intoBoard
and exposed asIDetaildBoard
interfaceUserDetails
removed - merged intoUser
and exposed asIDetailedUser
interfaceUserBoard
removed - merged intoBoard
and exposed asIUserBoard
interfaceUserPin
removed - merged intoPin
and exposed asIUserPin
interface
- Counts
BoardCounts
removed - merged into newCounts
and exposed asIBoardCounts
interfacePinCounts
removed - merged into newCounts
and exposed asIPinCounts
interfaceUserCounts
removed - merged into newCounts
and exposed asIUserCounts
interface
- Images
BoardImages
removed - merged into newImageList
and exposed asIBoardImageList
interfacePinImages
removed - merged into newImageList
and exposed asIPinImageList
interfaceUserImages
removed - merged into newImageList
and exposed asIUserImageList
interface
Examples
You need an access token to use the API.
If you don't have one already you can generate one here: https://developers.pinterest.com/tools/access_token/
// Create a client with your access token
var client = new PinSharpClient("AB_IBS7Q0fFQbXJ90JGtSDXNMV-tEBkfLftbK6JCpEWkGoA_MwAAAAA");
// Get board information
var board = await client.Boards.GetBoardAsync("machineshopcafe/best-of-mclaren-machine");
// Get pins on board
var pins = await client.Boards.GetPinsAsync("machineshopcafe/best-of-mclaren-machine");
// Get pins on board but only with fields 'creator' and 'board' as dynamic or your own type
var pins = await client.Boards.GetPinsAsync<dynamic>("rice_up/tableware", new[] { "creator", "board" });
// Get user info of the user associated with the access token
var user = await client.Me.GetUserAsync();
// Get pins of the user associated with the access token
var pins = await client.Me.GetPinsAsync();
// Get boards of the user associated with the access token
var boards = await client.Me.GetBoardsAsync();
// Search the associated user's pins or boards
var pins = await client.Me.SearchPinsAsync("mclaren");
var boards = await client.Me.SearchBoardsAsync("mclaren");
// Create new pin
var newPin = await client.Pins.CreatePinAsync("machineshopcafe/best-of-mclaren-machine", "http://i.imgur.com/abcdef.jpg", "Looks so cool!");
// Follow/unfollow board or user
await client.Me.FollowBoardAsync("machineshopcafe/best-of-mclaren-machine");
await client.Me.UnfollowBoardAsync("machineshopcafe/best-of-mclaren-machine");
await client.Me.FollowUserAsync("machineshopcafe");
await client.Me.UnfollowUserAsync("machineshopcafe");
Product | Versions 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 | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. 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 | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- Newtonsoft.Json (>= 9.0.1)
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.0)
- Newtonsoft.Json (>= 9.0.1)
- System.Net.Http (>= 4.1.1)
- System.Reflection (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Updated with .NET Core support, rate limit information and custom exceptions.