Skip to content
C# API interface for the blogging platform dev.to (DEV)
C# PowerShell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
build
src
tests/DevTo.Api.Tests
.appveyor.yml
.codecov.yml
.editorconfig
.gitattributes
.gitignore
CodeCoverage.runsettings
DevToApi.sln
License.txt
build.appveyor.ps1
build.ps1
buildconfig.json
readme.md

readme.md

Dev.to API for .NET

API interface for the blogging platform dev.to (DEV)

AppVeyor Codecov NuGet

Supports

  • Create article
  • Update article
  • Get user articles (these are articles related to the API key)
  • Get articles
  • Get articles by tag
  • Get articles by user
  • Get article (including article body)
  • Get tags

Where available, supports basic pagination to request additional data.

Getting Started

With DI

using Microsoft.Extensions.DependencyInjection;

services.AddDevToApi(new Uri("https://dev.to/"));
using DevTo.Api;

public class MyClass
{
	private IArticlesApi ArticlesApi { get; }
	private ITagsApi TagsApi { get; }

	public MyClass(IArticlesApi articlesApi, ITagsApi tagsApi)
	{
		ArticlesApi = articlesApi;
		TagsApi = tagsApi;
	}

	public async Task DoWork()
	{
		var articles = await ArticlesApi.GetArticlesAsync();
		
		// Your code here...
	}
}

Without DI

using DevTo.Api;
using System.Net.Http;

var articlesService = new ArticlesService(new Uri("https://dev.to/"), new HttpClient());
var tagsService = new TagsService(new Uri("https://dev.to/"), new HttpClient());

var articles = await articlesService.GetArticlesAsync();
You can’t perform that action at this time.