Skip to content

Releases: repasscloud/SugarNews-API-csharp-client

v1.0.4

24 Jun 09:10

Choose a tag to compare

Release Notes - Version 1.0.2

Overview

Un-simplified code, this had an averse effect on the projects operational working #5

New Features

  • n/a

Bug Fixes

  • n/a

Improvements

  • n/a

Known Issues

  • n/a

Acknowledgements

Acknowledge contributions, dependencies, or any other important mentions:

Additional Information

n/a


Thank you for your support and feedback! If you encounter any issues or have suggestions, please don't hesitate to report them or contact us.

We hope you enjoy using the latest release!

v1.0.2

24 Jun 08:47

Choose a tag to compare

Release Notes - Version 1.0.2

Overview

Un-simplified code, this had an averse effect on the projects operational working #5

New Features

  • n/a

Bug Fixes

  • n/a

Improvements

  • n/a

Known Issues

  • n/a

Acknowledgements

Acknowledge contributions, dependencies, or any other important mentions:

Additional Information

n/a


Thank you for your support and feedback! If you encounter any issues or have suggestions, please don't hesitate to report them or contact us.

We hope you enjoy using the latest release!

v1.0.0

23 Jun 15:48

Choose a tag to compare

SugarNews API client library for .NET (C#)

SugarNews API is a simple .NET 7.0 HTTP REST API for searching and retrieving live articles from all over the web from NewsAPI.org. It can help you answer questions like:

  • What top stories is the NY Times running right now?
  • What new articles were published about the next iPhone today?
  • Has my company or product been mentioned or reviewed by any blogs recently?

You can search for articles with any combination of the following criteria:

  • Keyword or phrase. Eg: find all articles containing the word 'Microsoft'.
  • Date published. Eg: find all articles published yesterday.
  • Source name. Eg: find all articles by 'TechCrunch'.
  • Source domain name. Eg: find all articles published on nytimes.com.
  • Language. Eg: find all articles written in English.

You can sort the results in the following orders:

  • Date published
  • Relevancy to search keyword
  • Popularity of source

You need an API key to use the API - this is a unique key that identifies your requests. They're free for development, open-source, and non-commercial use. You can get one here: https://newsapi.org.

Installation

The SugarNews API client library is available on Nuget. You can install it either through the Nuget package management window in Visual Studio by searching for SugarNewsAPI, or by running the following in the package manager console:

PM> Install-Package SugarNewsAPI

Usage example

using SugarNewsAPI;
using SugarNewsAPI.Models;
using SugarNewsAPI.Constants;
using System;

namespace MyApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            // init with your API key (get this from newsapi.org)
            var newsApiClient = new SugarNewsApiClient("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

            var articlesResponse = newsApiClient.GetEverything(new EverythingRequest
            {
                Q = "Apple",
                SortBy = SortBys.Popularity,
                Language = Languages.EN,
                From = new DateTime(2018, 1, 25)
            });

            if (articlesResponse.Status == Statuses.Ok)
            {
                // total results found
                Console.WriteLine(articlesResponse.TotalResults);

                // here's the first 20
                foreach (var article in articlesResponse.Articles)
                {
                    // title
                    Console.WriteLine(article.Title);
                    // author
                    Console.WriteLine(article.Author);
                    // description
                    Console.WriteLine(article.Description);
                    // url
                    Console.WriteLine(article.Url);
                    // image
                    Console.WriteLine(article.UrlToImage);
                    // published at
                    Console.WriteLine(article.PublishedAt);
                }
            }

            Console.ReadLine();
        }
    }
}

v0.1.6

23 Jun 15:45

Choose a tag to compare

v0.1.6 Pre-release
Pre-release
Verison 0.1.6