Unparalleled suite of productivity-boosting Web APIs & cloud-based micro-service applications for developers and companies of any size.

APIFinanceNews and Updates

How to Create a Financial News App Using FinanceLayer API

Earlier, we created a news web app with the MediaPlayer API.  Today, however, you will learn how to create cross-platform financial news applications with Delphi and FireMonkey using the FinanceLayer API.

 

What is FinanceLayer API?

The FinanceLayer API provides a powerful, scalable, yet easy-to-use REST API interface that delivers worldwide live and historical financial news data in a handy JSON format.  The API comes with a single news HTTP GET endpoint.  It also has a series of parameters and options you can use to narrow down your finance news data results.  Among its other options, you can filter by date timeframe and source. You can also search keywords, tags, and tickers. Another great API to pair with this API is a currency exchange rate API.

API integration with Delphi FireMonkey

We’ll create our finance news app with Delphi FireMonkey.  We will also try to utilize all the functionalities of the FinanceLayer API.  This will showcase the FinanceLayer API as well as Delphi FireMonkey.

Get your Free API Access Key!

First, be sure to head over to the subscription page and register to get a free API access key right now!  With the API access key, you can use the FinanceLayer API simply by adding it to your request URL.

The FinanceLayer API response is JSON-based.  It’s also very straightforward.  In addition, you can parse and use it in any programming language.  Below is an example of an API response that provides financial news.

API Features

The FinanceLayer API provides several functionalities.  For instance, with FinanceLayer API you can request: 

  • Live Financial News
  • Historical News based on the date
  • Specific sources to get the news
  • Keyword searches
  • Tag searches

As an example, you can search for salesforce within a specified source like forbes.com. The final request URL looks this:

If you want historical financial news and have subscribed to the Standard Plan or higher, then you can use data parameters to get historical data.  You can also use the date parameter in several ways.

  • Today
  • thisweek
  • thismonth
  • last7days
  • yeartodate
  • YYYY-MM-DD
  • last3months
  • and more

Here is an example of how the date feature works:

How do I narrow down searches?

If you want specific articles based on keywords, then you can use keywords or ticker parameters to get your news.  You can specify one or multiple comma-separated search keywords. Like FinanceLayer’s other parameters, you can also exclude keywords by prepending a symbol. Take a look at these examples:

How to Create a Native Cross-Platform Finance News App?

As I said earlier, you can use the Delphi and the FireMonkey framework to create a native cross-platform app.

What is Delphi?

With Delphi, you can build applications 5x faster with one codebase for Windows, Android, iOS, macOS, and Linux.  The latest release, Delphi  11 Alexandria supports high-DPI and 4K+ screens, provisioning for Windows 11, Android 30 API, as well as the macOS 64-bit ARM M1 processor.

What is FireMonkey?

FireMonkey (FMX) is a cross-platform application framework that allows developers to create exciting user interfaces and deliver applications on multiple operating systems (Windows, Android, iOS, macOS, Linux, and HTML5).

How to Integrate APIs into Delphi FireMonkey application?

Delphi FireMonkey comes with hundreds of built-in components.  These include REST Client components you can use to consume any type of web service API.  Moreover, you can establish a connection with RAD Studio REST Debugger, and then copy pre-configured components and paste them into the form.  After that, you are ready to go.

Here is the project structure for our demo applications:

As you can see there is not much code, because everything we need is done dynamically.

Here is the main code you need for this project.

  • REST Components are pasted from REST Debugger (pre-configured)
  • All the UI elements are also implemented dynamically.

This is the final result:

Check out the whole source in this repository.

This is the function for the live news and component creation:

This function uses the TDateEdit component and sends a request to the historical news API endpoint:

Be sure to head over to the FinanceLayer web page and get your free API access key.

 

 

Related posts
API

How To Create A Weather App For Windows And Mobile Using An API

API

The 5 Types of API Marketplaces

API

Building Your Own Geolocation App with IP Geolocation API

APIIPLocation

What Is Geoblocking And How Does It Work?

Leave a Reply

Your email address will not be published. Required fields are marked *