The Medium API SDK for .NET provides access to the Medium API REST APIs from .NET applications.
Medium API helps you to quickly extract data from Medium's Website (https://medium.com).
You can gather data related to users, publications, articles (including its textual content), latest posts & top writers within a topic/niche, etc…
Add the .NET SDK as a project reference into your solution:
dotnet add reference <path-to-sdk>/MediumApi.csprojRegister the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through MediumApiClientOptions.
services.AddMediumApiClient(options =>
{
options.ApiHost = "YOUR_API_KEY";
options.ApiKey = "YOUR_API_KEY";
options.Environment = ServerEnvironment.Production;
// TODO: configure more client options here
});Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through MediumApiClientOptions.
var httpClient = new HttpClient();
// TODO: configure more client options here
var options =
new MediumApiClientOptions
{
ApiHost = "YOUR_API_KEY",
ApiKey = "YOUR_API_KEY",
Environment = ServerEnvironment.Production,
};
var client = new MediumApiClient(httpClient, options);For code examples and error responses, see API Reference.
Tip
Use a single MediumApiClient instance for the lifetime of your application and
reuse it across all requests. Creating a new instance per request might exhaust the
connection pool.
This SDK is distributed under the MIT License.
Refer to the API reference for detailed information on available operations with code samples.
For further assistance, please contact support at [email protected].