I was going through my public GitHub, cleaning some projects up and I noticed that I don’t really have any projects that properly showcase consuming and digesting an API. I do have a few that are private which I intend to keep private for the foreseeable future. This might be a great time to build a new project that can show off the skills required to contact an API and play with the data. Also, it could create some content for my website. As I go along with creating this project, I can write posts about some concepts and issues that I run into. It should make for a fun time.

Where To Start

Thinking

Just saying that I am going to create a project is easier said than done. So where do I start? Well that’s a great question me! To start, I have scoured the interwebs for some fun looking APIs. There were a few that caught my eye; YouTube video, SMS, Email and City data APIs to name a few. Then I came across one which provides you with news results after providing a custom search as a payload.

As of right now (all ideas are subject to change), I think using this API will be beneficial because you can create custom calls to it with various parameters. You can do custom keyword, domain and country searches with this API endpoint. You can also choose to include, up to five I believe, various languages to choose from for news searches. By having a lot of functionality, this API will be really beneficial to showcase on my public GitHub. Plus, there is a free tier for using this API, so if someone wants to signup for a free API key, they can. From there, they can put their API key into my application (probably a supporting configuration file), compile it and start reading the news.

The Idea

I have been seeing a lot of cool console applications in recent months. This has inspired me to access my news via the command line, so this will be a console application. I want it to be cross platform as well as written in a language that I am familiar with, so this project will be written with C# and built on .NET 6.

For the workflow, I am going to try to keep it simple. Once I add it to my GitHub, I will probably make some modifications. Essentially when the application is launched, I will have a configuration file (JSON) that will be accessed to get certain settings. These settings might be default language and country sources so that the user will not have to set those each time they want to make a query. Also, there will be a submenu so that the user can change these settings whenever they choose to. Once the settings are loaded in, the menu might give you a few options to choose from to gather your news. These could be just grabbing the latest news or getting the news based on a search term(s). After the selection, the API will be called. Once the API response payload is received, the application will digest it (added data to the custom C# classes). From there, the application will show a selection menu and the user can navigate the various news articles. Here is a loose diagram of how it will work:

Rough-Draft

Again, this is just a rough outline of the application, so things might be added or taken away. If you have any ideas or suggestions, reach out to me via Twitter. To be continued…