Skip to content

podobaas/DevToAPI

Repository files navigation

DevToAPI - Forem/DEV API Client Library for .NET

.NET Framework .NET Standard
GitHub Workflow Status Codacy grade Nuget version Nuget GitHub



Implemented endpoints

Route Methods
Articles All methods
Comments All methods
Follows All methods
Followers All methods
Listings All methods
Organizations All methods
Podcast episodes All methods
Reading list All methods
Tags All methods
Users All methods
Videos All methods
Webhooks All methods
Profile images All methods
Admin configuration All methods

Install

DevToAPI is available for install from NuGet

dotnet add package DevToAPI

Usage examples

Create new article

var client = new DevToClient("api-key");
await client.Articles.CreateAsync(new CreateArticle()
{
    Title = "My post",
    BodyMarkdown = "...",
    Tags = new List<string>()
    {
        "csharp",
        "opensource"
    },
    Published = true
});

Specific page

var client = new DevToClient("api-key");
var pagination = await client.Articles.GetAllMyAsync(option =>
{
    option.Page = 5;
    option.PageSize = 10;
});

Pagination

var client = new DevToClient("api-key");
var pagination = await client.Articles.GetAllMyAsync();

while (pagination.CanMoveNext)
{
    var myArticles = pagination.Items;

    //do stuff

    await pagination.NextPageAsync();
}

Supported Platforms

  • .NET 4.5.2 or greater
  • .NET Standard 2.0 or greater

Documentation

Check out DEV API documentation

References