PodcastAPI 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package PodcastAPI --version 1.0.3
NuGet\Install-Package PodcastAPI -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PodcastAPI" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PodcastAPI --version 1.0.3
#r "nuget: PodcastAPI, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PodcastAPI as a Cake Addin
#addin nuget:?package=PodcastAPI&version=1.0.3

// Install PodcastAPI as a Cake Tool
#tool nuget:?package=PodcastAPI&version=1.0.3

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

Using the [.NET Core command-line interface (CLI) tools][dotnet-core-cli-tools]:

dotnet add package PodcastAPI

Using the [NuGet Command Line Interface (CLI)][nuget-cli]:

nuget install PodcastAPI

Using the [Package Manager Console][package-manager-console]:

Install-Package PodcastAPI

From within Visual Studio:

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages...
  4. Click on the Browse tab and search for "PodcastAPI".
  5. 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;
using PodcastAPI;
using PodcastAPI.Exceptions;

namespace PodcastApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var apiKey = Environment.GetEnvironmentVariable("LISTEN_API_KEY");

            try
            {
                var client = new 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 (AuthenticationException ex)
            {
                Console.WriteLine($"Authentication Issue: {ex.Message}");
            }
            catch (InvalidRequestException ex)
            {
                Console.WriteLine($"Invalid Request: {ex.Message}");
            }
            catch (RateLimitException ex)
            {
                Console.WriteLine($"Rate Limit: {ex.Message}");
            }
            catch (NotFoundException ex)
            {
                Console.WriteLine($"Not Found: {ex.Message}");
            }
            catch (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.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.6 394 9/8/2023
1.1.5 206 4/19/2023
1.1.4 977 7/28/2022
1.1.1 554 3/10/2022
1.1.0 428 10/26/2021
1.0.4 465 5/12/2021
1.0.3 285 5/12/2021
1.0.2 272 5/12/2021
1.0.1 289 5/12/2021

Initial release