Laravel interview questions


1) What is Laravel?
2) Explain Events in laravel ?
3) Explain validations in laravel?
4) How to install laravel via composer ?
5) List some features of laravel 6 ?
6) What is PHP artisan. List out some artisan commands ?
7) List some default packages provided by Laravel Framework?
8) What are named routes in Laravel?
9) What is database migration. How to create migration via artisan ?
10) What are service providers in Laravel ?
11) Explain Laravel’s service container ?
12) What is composer ?
13) What is dependency injection in Laravel ?
14) What are Laravel Contract’s ?
15) Explain Facades in Laravel ?
16) What are Laravel eloquent?
17) How to enable query log in Laravel ?
18) What is reverse routing in Laravel?
19) How to turn off CRSF protection for specific route in Laravel?
20) What are traits in Laravel?
21) Does Laravel support caching?
22) Explain Laravel’s Middleware?
23) What is Lumen?
24) Explain Bundles in Laravel?
25) How to use custom table in Laravel Modal ?
Last Updated: May 22, 2020,
Posted in Interview Questions,
40 Questions
Laravel interview questions
What is Laravel?
Laravel is a Symfony based free open-source PHP web framework. It is created by Taylor Otwell and allows developers to write expressive, elegant syntax. Laravel comes with built-in support for user authentication and authorization which is missing in some most popular PHP frameworks like CodeIgniter, CakePHP.Here you will find Latest Laravel interview questions and answer that helps you crack Laravel Interviews.


Quick Questions About Laravel
Laravel is written In PHP Programming (PHP 7)
Laravel is a PHP Framework for Developing websites and mobile API's.
Laravel is developed By Taylor Otwell
Laravel is Based on MVC architectural pattern
Laravel Dependencies Composer, OpenSSL, PDO, Mbstring, etc.
Laravel Licence MIT License
Laravel Current Stable release 6.9.0
Below are the list of Best Laravel interview questions and Answers

1) What is Laravel?
Laravel is a free open source "PHP framework" based on the MVC design pattern.
It is created by Taylor Otwell. Laravel provides expressive and elegant syntax that helps in creating a wonderful web application easily and quickly.

Pause
Unmute
Remaining Time -9:16
Fullscreen
VDO.AI

2) Explain Events in laravel ?
An event is an action or occurrence recognized by a program that may be handled by the program or code. Laravel events provides a simple observer implementation, that allowing you to subscribe and listen for various events/actions that occur in your application.

All Event classes are generally stored in the app/Events directory, while their listeners are stored in app/Listeners of your application.

3) Explain validations in laravel?
In Programming validations are a handy way to ensure that your data is always in a clean and expected format before it gets into your database.

Laravel provides several different ways to validate your application incoming data.By default Laravel’s base controller class uses a ValidatesRequests trait which provides a convenient method to validate all incoming HTTP requests coming from client.You can also validate data in laravel by creating Form Request.

Laravel validation Example

$validatedData = $request->validate([
            'name' => 'required|max:255',
            'username' => 'required|alpha_num',
            'age' => 'required|numeric',
        ]);

4) How to install laravel via composer ?
You can install Laravel via composer by running below command.

composer create-project laravel/laravel your-project-name version
Also Read Core PHP Interview Questions and Answers for 2019

5) List some features of laravel 6 ?
Laravel 6 features

Inbuilt CRSF (cross-site request forgery ) Protection.
Inbuilt paginations
Reverse Routing
Query builder
Route caching
Database Migration
IOC (Inverse of Control) Container Or service container.
Job middleware
Lazy collections
6) What is PHP artisan. List out some artisan commands ?
PHP artisan is the command line interface/tool included with Laravel. It provides a number of helpful commands that can help you while you build your application easily. Here are the list of some artisan command:-

php artisan list
php artisan help
php artisan tinker
php artisan make
php artisan –versian
php artisan make model model_name
php artisan make controller controller_name
7) List some default packages provided by Laravel Framework?
Below are a list of some official/ default packages provided by Laravel

Cashier
Envoy
Passport
Scout
Socialite
Horizon
Telescope
8) What are named routes in Laravel?
Named routing is another amazing feature of Laravel framework. Named routes allow referring to routes when generating redirects or Urls more comfortably.
You can specify named routes by chaining the name method onto the route definition:

Route::get('user/profile', function () {
    //
})->name('profile');

You can specify route names for controller actions:

Route::get('user/profile', 'UserController@showProfile')->name('profile');
Once you have assigned a name to your routes, you may use the route's name when generating URLs or redirects via the global route function:

// Generating URLs...
$url = route('profile');
// Generating Redirects...
return redirect()->route('profile');
9) What is database migration. How to create migration via artisan ?
Migrations are like version control for your database, that’s allow your team to easily modify and share the application’s database schema. Migrations are typically paired with Laravel’s schema builder to easily build your application’s database schema.

Use below commands to create migration data via artisan.

// creating Migration
php artisan make:migration create_users_table
10) What are service providers in Laravel ?
Service Providers are central place where all laravel application is bootstrapped . Your application as well all Laravel core services are also bootstrapped by service providers.
All service providers extend the Illuminate\Support\ServiceProvider class. Most service providers contain a register and a boot method. Within the register method, you should only bind things into the service container. You should never attempt to register any event listeners, routes, or any other piece of functionality within the register method.
You can read more about service provider from here

11) Explain Laravel’s service container ?
One of the most powerful feature of Laravel is its Service Container. It is a powerful tool for resolving class dependencies and performing dependency injection in Laravel.
Dependency injection is a fancy phrase that essentially means class dependencies are “injected” into the class via the constructor or, in some cases, “setter” methods.

12) What is composer ?
Composer is a tool for managing dependency in PHP. It allows you to declare the libraries on which your project depends on and will manage (install/update) them for you.
Laravel utilizes Composer to manage its dependencies.

13) What is dependency injection in Laravel ?
In software engineering, dependency injection is a technique whereby one object supplies the dependencies of another object. A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it. The service is made part of the client’s state.[1] Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.
https://en.wikipedia.org/wiki/Dependency_injection
You can do dependency injection via Constructor, setter and property injection.

14) What are Laravel Contract’s ?
Laravel's Contracts are nothing but a set of interfaces that define the core services provided by the Laravel framework.
Read more about laravel Contract’s

15) Explain Facades in Laravel ?
Laravel Facades provides a static like an interface to classes that are available in the application’s service container. Laravel self-ships with many facades which provide access to almost all features of Laravel ’s. Laravel facades serve as “static proxies” to underlying classes in the service container and provide benefits of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods of classes. All of Laravel’s facades are defined in the Illuminate\Support\Facades namespace. You can easily access a facade like so:


use Illuminate\Support\Facades\Cache;

Route::get('/cache', function () {
    return Cache::get('key');
});
16) What are Laravel eloquent?
Laravel's Eloquent ORM is simple Active Record implementation for working with your database. Laravel provide many different ways to interact with your database, Eloquent is most notable of them. Each database table has a corresponding “Model” which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table.

Below is sample usage for querying and inserting new records in Database with Eloquent.


// Querying or finding records from products table where tag is 'new'
$products= Product::where('tag','new');
// Inserting new record
 $product =new Product;
 $product->title="Iphone 7";
 $product->price="$700";
 $product->tag='iphone';
 $product->save();
17) How to enable query log in Laravel ?
Use the enableQueryLog method to enable query log in Laravel


DB::connection()->enableQueryLog();
You can get array of the executed queries by using getQueryLog method:
$queries = DB::getQueryLog();
18) What is reverse routing in Laravel?
Laravel reverse routing is generating URL's based on route declarations. Reverse routing makes your application so much more flexible. It defines a relationship between links and Laravel routes. When a link is created by using names of existing routes, appropriate Uri's are created automatically by Laravel. Here is an example of reverse routing.

// route declaration

Route::get('login', 'users@login');
Using reverse routing we can create a link to it and pass in any parameters that we have defined. Optional parameters, if not supplied, are removed from the generated link.

{{ HTML::link_to_action('users@login') }}
It will automatically generate an Url like http://xyz.com/login in view.

19) How to turn off CRSF protection for specific route in Laravel?
To turn off CRSF protection in Laravel add following codes in “app/Http/Middleware/VerifyCsrfToken.php”


//add an array of Routes to skip CSRF check
private $exceptUrls = ['controller/route1', 'controller/route2'];
 //modify this function
public function handle($request, Closure $next) {
 //add this condition foreach($this->exceptUrls as $route) {
 if ($request->is($route)) {
  return $next($request);
 }
}
return parent::handle($request, $next);
}
20) What are traits in Laravel?
PHP Traits are simply a group of methods that you want include within another class. A Trait, like an abstract class cannot be instantiated by itself.Trait are created to reduce the limitations of single inheritance in PHP by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies.

Here is an example of trait.

trait Sharable {

  public function share($item)
  {
    return 'share this item';
  }

}
You could then include this Trait within other classes like this:


class Post {

  use Sharable;

}

class Comment {

  use Sharable;

}
Now if you were to create new objects out of these classes you would find that they both have the share() method available:


$post = new Post;
echo $post->share(''); // 'share this item'

$comment = new Comment;
echo $comment->share(''); // 'share this item'
21) Does Laravel support caching?
Yes, Laravel supports popular caching backends like Memcached and Redis.
By default, Laravel is configured to use the file cache driver, which stores the serialized, cached objects in the file system.For large projects, it is recommended to use Memcached or Redis.

22) Explain Laravel’s Middleware?
As the name suggests, Middleware acts as a middleman between request and response. It is a type of filtering mechanism. For example, Laravel includes a middleware that verifies whether the user of the application is authenticated or not. If the user is authenticated, he will be redirected to the home page otherwise, he will be redirected to the login page.

There are two types of Middleware in Laravel.
Global Middleware: will run on every HTTP request of the application.
Route Middleware: will be assigned to a specific route.
Read more about Laravel middlewares

23) What is Lumen?
Lumen is PHP micro-framework that built on Laravel’s top components.It is created by Taylor Otwell. It is perfect option for building Laravel based micro-services and fast REST API’s. It’s one of the fastest micro-frameworks available.
You can install Lumen using composer by running below command

composer create-project --prefer-dist laravel/lumen blog
24) Explain Bundles in Laravel?
In Laravel, bundles are also called packages. Packages are the primary way to extend the functionality of Laravel. Packages might be anything from a great way to work with dates like Carbon, or an entire BDD testing framework like Behat.In Laravel, you can create your custom packages too. You can read more about packages from here

25) How to use custom table in Laravel Modal ?
You can use custom table in Laravel by overriding protected $table property of Eloquent.


Below is sample uses

class User extends Eloquent{
 protected $table="my_user_table";

}
26) List types of relationships available in Laravel Eloquent?
Below are types of relationships supported by Laravel Eloquent ORM.

One To One
One To Many
One To Many (Inverse)
Many To Many
Has Many Through
Polymorphic Relations
Many To Many Polymorphic Relations
You can read more about relationships in Laravel Eloquent from here

27) Why are migrations necessary?
Migrations are necessary because:

Without migrations, database consistency when sharing an app is almost impossible, especially as more and more people collaborate on the web app.
Your production database needs to be synced as well.
28) Provide System requirements for installation of Laravel framework ?
In order to install Laravel, make sure your server meets the following requirements:

PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
29) List some Aggregates methods provided by query builder in Laravel ?
count()
max()
min()
avg()
sum()
Also Read Laravel 5 interview questions 2019

30) How to check request is ajax or not ?
In Laravel, we can use $request->ajax() method to check request is ajax or not.

Example:

      public function saveData(Request $request)
        {
            if($request->ajax()){
                return "Request is of Ajax Type";
            }
            return "Request is of Http type";
        }
31) Explain Inversion of Control, how to implement it.
Inversion of control is a design pattern that is used for decoupling components and layers of a system. Inversion of control(IOC) is implemented through injecting dependencies into a component when it is constructed.

32) What is Singleton design pattern?
Singleton design pattern is a creational pattern that is used whenever only one instance an object is needed to be created. In this pattern, you can't initialize the class.

33) Explain Dependency Injection and its types?
Dependency injection is way to pass one obeject dependencies to another object.It is a broader form of inversion of control (IOC).

There are basically 3 types of dependency injection:

constructor injection
setter injection
Interface injection
Click Here to Read More 100 Questions on Laravel 5 & 6

34) What is Laravel Vapor?
It is a serverless deployment platform that is powered by AWS.Laravel Vapor provides on-demand auto-scaling with zero server maintenance.

35) What are pros and cons of using Laravel Framework?
Pros of using Laravel Framework
Laravel framework has in-built lightweight blade template engine to speed up compiling task and create layouts with dynamic content easily.
Hassles code reusability.
Eloquent ORM with PHP active record implementation
Built in command line tool “Artisan” for creating a code skeleton , database structure and build their migration
Cons of using laravel Framework
Development process requires you to work with standards and should have real understanding of programming
Laravel is new framework and composer is not so strong in compare to npm (for node.js), ruby gems and python pip.
Development in laravel is not so fast in compare to ruby on rails.
Laravel is lightweight so it has less inbuilt support in compare to django and rails. But this problem can be solved by integrating third party tools, but for large and very custom websites it may be a tedious task
36) What is the Laravel Cursor?
The cursor method in the Laravel is used to iterate the database records using a cursor. It will only execute a single query through the records. This method is used to reduce the memory usage when processing through a large amount of data.

Example of Laravel Cursor

foreach (Product::where(‘name’, ‘Bob’)->cursor() as $fname) {
//do some stuff
}

37) What is the use of dd() in Laravel?
In Laravel, dd() is a helper function used to dump a variable's contents to the browser and stop the further script execution. It stands for Dump and Die. It is used to dump the variable/object and then die the script execution. You can also isolate this function in a reusable functions file or a Class.

38) What is yield in Laravel?
In Laravel, @yield is principally used to define a section in a layout and is constantly used to get content from a child page unto a master page. So, when the Laravel performs blade file, it first verifies if you have extended a master layout, if you have extended one, then it moves to the master layout and commences getting the @sections.

39) How to clear Cache in Laravel?
You can use php artisan cache:clear commnad to clear Cache in Laravel.

40) What is Laravel nova?
Laravel Nova is an admin panel by laravel ecosystem. It easy to install and maintain. Laravel Nova comes with features that have ability to administer our database records using Eloquent.

Ads Free Download our Android app for Laravel interview questions (Interview Mocks )

Got a Questions? Share with us
Your Email
Question
Answer
Points to be remembered while appearing in Laravel Interviews :
Laravel is developed on the MVC (Model-View-Controller) design pattern.
Laravel comes with inbuilt features/ modules like authentication, authorization, localization, models, views, sessions, paginations and routing
Laravel supports advanced concepts of PHP and OOPs like Dependency Injection, traits, Contracts, bundles, Namespaces, Facades
Laravel supports Multiple Databases like MySQL, PostgreSQL, SQLite, SQL Server.
Laravel allows developers to write a clean and modular code.
Laravel supports blade Template Engine
Laravel comes with Official Packages like Cashier, Envoy, Horizon, Passport, Scout, Socialite
Laravel can be used with various popular Javascript Frameworks Like AngularJs, VueJs, ReactJS.
Frequently Asked Laravel Developer Interview Questions.
What is Laravel migration?
Migration in the Laravel is used to modify and share the structure of your database. It is paired with the schema builder in the Laravel to build the database for your application. It acts as a version control but for the Laravel database. There are two methods in the migration class, up and down. Up method is used to add tables, columns, to the database. The down method is used to reverse the operations of up. To create a migration, use make:migration command. To run the migration, use migrate command. It also offers a rollback feature.

Which version of Laravel you have used?
Answer the versions of Laravel you have worked on like Laravel 4, Laravel 5, Laravel 5.5, Laravel 6

What is socialite Laravel?
Laravel Socialite is an OAuth provider that is used to authenticate social media apps such as Facebook, Twitter, Google, and many more simply and seamlessly. It can be added to your Laravel web application using the dependency manager composer.

Why the composer is used in Laravel?
The composer in the Laravel is a dependency management tool that is used to install and manage libraries in your application. It does not install packages globally but on a per-application basis. Define the packages you want in the composer.json file and run the following command to install the packages in your application.

How can you update Laravel?
To upgrade your Laravel framework to the latest version, open the composer.json file and change the version of the Laravel framework to the newest version. Then run the following command to update your Laravel framework.

composer update
How to use Laravel tinker?
Laravel Tinker is a REPL that allows the developer to interact with the Laravel application through the command line. To enter into the Tinker environment, enter the following command

php artisan tinker
Tinker allows you to run commands such as clear-compiled, down, env, inspire, migrate, optimize, and up by default. To use more commands using Tinker, add the command to the command array that is present in the tinker.php configuration file.

How to use where relationship Laravel?
The where clause is a query builder that is used to verify something. Where has three arguments that it must require. The column name is the first argument with an operator as the second argument. The third argument is the value that the first operand must be evaluated using the operator.

Example
$users = DB::table('users')->where('salary', '=', 100)->get();
In the above example, the where clause is used to get the users who have the salary column that is equal to 100.

What is the difference between Laravel find and where?
The where clause in the query is used to verify and retrieve values. It has three arguments. First is the column name argument. Second is the operator. The third is the values that need to be checked with the column name. It retrieves the first model that is matching the given query.

Example
$users = DB::table('students')->where('marks', '=', 100)->get();
The find method is used to retrieve a single model instance instead of a collection of models. It retrieves the model by its primary key.
$users = StudentModel::find(1);
How to hash password in Laravel?
The Hash::make function is used to create a hash for the password.

Syntax:
Hash::make($password)
What are the Laravel guards?
The guard in Laravel is used to define the user authentication for each request. The Guards also provide a definition of user information storage and retrieval by the system. The session guard is a default guard in Laravel that is used to maintain the state using session storage and cookies. A web guard is used to store and retrieve session information. API guard is used to authenticate users and requests. These are some examples of default Laravel guard, and you can also create your own guard in Laravel.

API's to track COVID-19

API's to track COVID-19


API's can’t help cure COVID-19, but they can be used by developers to collect data about the outbreak, track its spread, and even produce data visualizations. Over the past month, ProgrammableWeb has been tracking APIs that provide access to data related to the pandemic. Here are 30 APIs that let developers leverage the available data about the virus. 

#1 About Corona COVID-19

The About Corona COVID-19 API provides statistics via REST API from the World Health Organization Situation Reports, Johns Hopkins CSSE, the U.S. Department of Health and Human Services, The National Health Commission of the People’s Republic of China, The European Centre for Disease Prevention and Control, and China CDC Weekly.
This API retrieves data by country including population, the number of cases confirmed, recovered, critical cases, deaths, recovered per death ratio, cases per million population, and more. The data is updated multiple times a day.

#2 Bing COVID-19 Data

The Bing COVID-19 Data API provides total confirmed cases, deaths, and recoveries by country. Data is sourced from the Centers for Disease Control and Prevention, World Health Organization, and the European Centre for Disease Prevention and Control. The API is used as a source for a live map tracker from Microsoft Bing.



The Bing COVID-19 Data API is the source for a live map tracker from Microsoft Bing. Source: Microsoft
The Bing COVID-19 Data API is the source for a live map tracker from Microsoft Bing. Source: Microsoft

#3 COVID19INDIA API 

The COVID19INDIA API is a Coronavirus tracker for cases in India. The API returns daily confirmed cases, daily deceased cases, and daily recovered cases as time-series data. This information is also available cumulatively and per district. 

#4 COVID-19-REPORT

The COVID-19-REPORT API tracks COVID-19 cases worldwide. Developers can retrieve brief reports, brief time series, latest cases in the world or in a specific region or country.  

#5 Coronavirus Data

The Coronavirus Data API enables COVID-19 information sourced from Johns Hopkins CSSE. The API returns cases by country and are updated daily. A streaming API that tracks this API is also available that uses Webhooks to notify when new daily data is retrieved.

#6 api-covid-19-india

The api-covid-19-india API retrieves daily statistics, hospital and bed numbers, contact and helplines, and notifications. It also displays unofficial patient tracing data, unofficial statewide information, and unofficial patient travel history. Data is sourced from The Ministry of Health and Family Welfare as the official source and the India COVID-19 Tracker as an unofficial source. 

#7 UK Coronavirus Data

The UK Coronavirus Data API serves as a data crawler to get COVID-19 figures from The National Health Service’s official website. 

#8 Mathdroid COVID-19

The Mathdroid COVID-19 API returns COVID-19 global data from The Center for Systems Science and Engineering (CSSE) at Johns Hopkins University. Routes contain global summaries, global cases, cases per day/region/country, deaths, and global recovered patients. 

#9 Ghana COVID-19

The Ghana COVID 19 API returns data about COVID-19 cases in Ghana and the world. Information includes confirmed and recovered cases. This API is built by independent developer Zakaria Mohammed.

#10 COVID2019 

COVID2019-API provides information about COVID-19. The API provides data on confirmed cases, deaths, recovered cases, and affected countries. This information is updated on a daily basis and is provided as time-series data. 

#11 COVID19 Real-Time Data

The COVID19 Real-Time Data API provides updated information related to coronavirus including the total count of cases, task force data in the U.S., travel health notices, cases in all U.S. states, and fatality rates by age and sex. 

#12 Robert-Koch Institut COVID-19 Data 

An API for the spread of COVID-19 in Germany and worldwide. Case numbers and deaths are available via the API.

#13 COVID Tracking Project API

The COVID Tracking Project is a volunteer effort, maintained through a partnership of The Atlantic and the founder of Related Sciences, that aims to be the most reliable source of state-level testing data through time. A RESTful API is available that tracks data on a state-level as well as for the entire U.S. Additionally, a GraphQL version of the API is also available.

#14 Coronavirus Tracker API

The Coronavirus Tracker is a simple API for tracking the COVID-19 outbreak that comes from Norwegian developer ExpDev. Users can query the RESTful API to get data about confirmed cases, deaths, and the number of recovered patients. Data sources include the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE), and the Conference of State Bank Supervisors. Community SDKs are also available in eight languages.

#15 Covidapi.info API 

The covidapi.info API builds upon the COVID-19 dataset of John Hopkins University. The data, originally in CSV format has been standardized and converted into queryable REST API endpoints. The endpoints are heavily cached and updated three times a day with a response time of sub 100 milliseconds. This API was built by developer Saiprasad Balasubramanian and contributors.

#16 Health Promotion Bureau COVID-19 API 

The Health Promotion Bureau (HPB) is a government agency in Sri Lanka charged with promoting health education and publicizing health information. The HPB has released an API that aims to make accurate information about COVID-19 patients, updated in real-time, available to the media. It is a RESTful API with responses formatted in JSON.

#17 Springer Open Access API 

The Springer Open Access API provides metadata and full-text content for more than 649,000 online documents from Springer Nature open access, including BioMed Central and SpringerOpen journals. The API offers access to the latest available research, evidence, and data. Any COVID-related content is currently free.

#18 Coronavirus API 

The Coronavirus REST API returns the current cases and more information about COVID-19 or the novel coronavirus strain. This API is free to use and requires no authentication. The API returns JSON formatted responses. The API supports country-specific responses. Additionally, a Node.js SDK is available to developers.

#19 Nubentos COVID-19 Tracking API

This API is from the self-proclaimed API marketplace for health, and it aims to provide valuable resources for tracking the novel coronavirus. It provides developers access to data collected from global health organizations and local administrations including the World Health Organization (WHO), U.S. Centers for Disease Control and Prevention (CDC), the Chinese Centre for Disease Control and Prevention (ECDC), China’s National Health Commission, and the Chinese Website DXY. You can read here for our coverage of the API.

#20 Health Gorilla Diagnostic Network API

Health Gorilla, a provider of clinical data interoperability, recently released this API to allow providers to submit orders for laboratory or radiology tests and receive the results electronically from vendors such as Labcorp, Quest Diagnostics, and Bioreference. The API can now be used to place COVID-19 test orders.

#21 New South Wales COVID-19 Cases API

This API, from developer Adam Lusted, provides the latest data about the coronavirus outbreak in New South Wales, Australia. Developers can use GET calls to query the number of confirmed cases, cases under investigation, cases acquired overseas, cases under investigation, and their respective reference sources.

#22 Smartable AI COVID-19 Stats and News API

Smartable AI is a company that uses AI to fight misinformation, curate content, and put information in order. It’s free COVID-19 Stats and News API offers recent and historic COVID-19 stats and news information per country or state. This is done in close to real-time by using AI to gather information from a number of data sources. Check out ProgrammableWeb‘s full coverage of the API. 

#23 COVID-19 GraphQL API

The first GraphQL API focused on the coronavirus comes from Ryan Lindskog. It enables mutable queries about COVID-19 and supports time-series data associated with deaths and cases by country. Additionally, the API returns the most recent confirmed cases per country. Data comes from the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).

#24 Health API

This is a RESTful API that also leverages JHU CSSE as its data source. It returns aggregated statistics (with total confirmed cases, deaths, and recovered), and country statistics.

#25 TheVirusTracker Coronavirus Data API

TheVirusTracker is a real-time service that tracks the coronavirus and provides updated news and data from outlets worldwide. The API is free to use and offers four data options related to COVID-19: global stats, country stats, full timeline, and country timeline.

#26 Octoparse

Octoparse is a web-scraping tool that includes an API for retrieving extracted data and using it in an application. Octoparse recently created a “recipe” that lets users extract live data from China Healthcare Department’s database.

#27 GHO OData API

With the GHO portal, users can query the World Health Organization’s data and statistics content. Data available includes various health indicators and the data associated with them, and dimensions such as education level and the data associated with them. The API uses the Open Data Protocol (OData) and supports both JSON and ATOM data formats.

#28 ReliefWeb API

ReliefWeb is a humanitarian information service provided by the United Nations Office for the Coordination of Humanitarian Affairs (OCHA). Content on this site including the latest reports, maps, and infographics from trusted sources, is delivered through the API. The API was used to create a daily map that tracks the outbreak among citizens of the EU.



The ReliefWeb API is used to create a daily map tracking the coronavirus outbreak. Image: OCHA
The ReliefWeb API is used to create a daily map tracking the coronavirus outbreak. Image: OCHA

#29 Aylien News API 

This API isn’t specifically aimed at tracking the coronavirus, but it is used to monitor worldwide news outlets in real-time to provide users with a news data feed. The Aylien team created a visualization that follows the spread of news coverage since the start of the year. The team used the News API to “map and analyze media reaction to the outbreak, plotting where and when the major events and announcements occurred.” The API itself returns parsed and analyzed news articles as JSON objects.



The Aylien News API was used to create a visualization showing the spread of news coverage of the virus outbreak. Source: Aylien blog
The Aylien News API was used to create a visualization showing the spread of news coverage of the virus outbreak. Source: Aylien blog

#30 OpenCage Geocoder API

This is another API that isn’t directly related to tracking data about the coronavirus. Instead, OpenCage Geocoder provides forward and reverse geocoding services via a RESTful API. The coronavirus Global Outbreak Monitor is a dashboard that pulls data from several sources to visualize and track the most recent reported cases on a daily basis. This dashboard uses the OpenCage Geocoder API to call the coordinates of new cases of the disease. Interested developers can learn about how the dashboard was built.
This article was originally published on ProgrammableWeb.
Check out the ProgrammableWeb directory for other APIs in the coronavirusHealthEmergencyGovernmentScienceMapping, and News Services categories.