PodcastAPI 1.0.4
See the version list below for details.
dotnet add package PodcastAPI --version 1.0.4
NuGet\Install-Package PodcastAPI -Version 1.0.4
<PackageReference Include="PodcastAPI" Version="1.0.4" />
paket add PodcastAPI --version 1.0.4
#r "nuget: PodcastAPI, 1.0.4"
// Install PodcastAPI as a Cake Addin
#addin nuget:?package=PodcastAPI&version=1.0.4
// Install PodcastAPI as a Cake Tool
#tool nuget:?package=PodcastAPI&version=1.0.4
Podcast API .Net Library
The Podcast API .Net library provides convenient access to the Listen Notes Podcast API from applications written in C#.
Simple and no-nonsense podcast search & directory API. Search the meta data of all podcasts and episodes by people, places, or topics. It's the same API that powers the best podcast search engine Listen Notes.
If you have any questions, please contact hello@listennotes.com
Installation
You can install our NuGet PodcastAPI package.
Using the .NET Core command-line interface (CLI) tools:
dotnet add package PodcastAPI
Using the NuGet Command Line Interface (CLI):
nuget install PodcastAPI
Using the Package Manager Console:
Install-Package PodcastAPI
From within Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "PodcastAPI".
- Click on the PodcastAPI package, select the appropriate version in the right-tab and click Install.
Requirements
- .Net 5.0+
Usage
The library needs to be configured with your account's API key which is
available in your Listen API Dashboard. Set apiKey
to its
value:
using System;
using System.Collections.Generic;
namespace PodcastApp
{
class Program
{
static void Main(string[] args)
{
var apiKey = Environment.GetEnvironmentVariable("LISTEN_API_KEY");
try
{
var client = new PodcastAPI.Client();
var parameters = new Dictionary<string, string>();
parameters.Add("q", "startup");
parameters.Add("type", "episodes");
var result = client.Search(parameters).Result;
var jsonObject = result.ToJSON<dynamic>();
Console.WriteLine($"Json Object: {jsonObject}");
var freeQuota = result.GetFreeQuota();
Console.WriteLine($"Free Quota: {freeQuota}");
var usage = result.GetUsage();
Console.WriteLine($"Usage: {usage}");
var nextBillingDate = result.GetNextBillingDate();
Console.WriteLine($"Next Billing Date: {nextBillingDate}");
}
catch (PodcastAPI.Exceptions.AuthenticationException ex)
{
Console.WriteLine($"Authentication Issue: {ex.Message}");
}
catch (PodcastAPI.Exceptions.InvalidRequestException ex)
{
Console.WriteLine($"Invalid Request: {ex.Message}");
}
catch (PodcastAPI.Exceptions.RateLimitException ex)
{
Console.WriteLine($"Rate Limit: {ex.Message}");
}
catch (PodcastAPI.Exceptions.NotFoundException ex)
{
Console.WriteLine($"Not Found: {ex.Message}");
}
catch (PodcastAPI.Exceptions.ListenApiException ex)
{
Console.WriteLine($"Exception: {ex.Message}");
}
catch (Exception ex)
{
Console.WriteLine($"Application Exception: {ex}");
}
}
}
}
If apiKey
is null or "", then we'll connect to a mock server that returns fake data for testing purposes.
Handling exceptions
Unsuccessful requests raise exceptions. The class of the exception will reflect the sort of error that occurred.
Exception Class | Description |
---|---|
AuthenticationException | wrong api key or your account is suspended |
ApiConnectionException | fail to connect to API servers |
InvalidRequestException | something wrong on your end (client side errors), e.g., missing required parameters |
RateLimitException | you are using FREE plan and you exceed the quota limit |
NotFoundException | endpoint not exist, or podcast / episode not exist |
ListenApiException | something wrong on our end (unexpected server errors) |
All exception classes can be found in this folder.
And you can see some sample code here.
API Reference
Each function is a wrapper to send an HTTP request to the corresponding endpoint on the API Docs, where you can see all parameters and response schemas.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
-
net5.0
- Newtonsoft.Json (>= 13.0.1)
- RestSharp (>= 106.11.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release