Download the PHP package gt-tech/gnews-api without Composer

On this page you can find all versions of the php package gt-tech/gnews-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gnews-api

Laravel GNews API

A PHP client for the GNews API.

Installation

You can install GNews API by using Composer

You can use the following composer command to install it into an existing laravel project.

Laravel will already register the service provider to your application because GNews API does make use of the extra laravel tag on the composer.json schema

Publish the configuration file

You can publish the configuration file of GNews API by running the following command:

Usage

After installation and publish configuration file in your project,

Get Your API key from here

Get TopHeadLines

Parameter Default Description
$q None Keep articles that matched keywords.
$topic breaking-news Set the articles topic. Topics available are breaking-news, world, nation, business, technology, entertainment, sports, science and health.
$from None Keep articles with a publication date greater than or equal to the given date. ISO 8601 format (e.g. 2021-06-19T07:32:32Z)
$to None Keep articles with a publication date less than or equal to the given date. ISO 8601 format (e.g. 2021-06-19T07:32:32Z)
$max 10 Set the maximum number of articles returned per query. 100 is the maximum value. The maximum value allowed depend on your plan (FREE has 10, PLUS has 30 and PRO has 100).
$country gr Set the country of returned articles. See countries list in config file.
$lang el Set the language of returned articles. See languages list in config file.

Get Search

Parameter Default Description
$q None Keep articles that matched keywords.
$from None Keep articles with a publication date greater than or equal to the given date. ISO 8601 format (e.g. 2021-06-19T07:32:32Z)
$to None Keep articles with a publication date less than or equal to the given date. ISO 8601 format (e.g. 2021-06-19T07:32:32Z)
$sort_by publishedAt Set the order in which the items are sorted. (publishedAt: sort articles first according to the most recent date of publication, relevance: sort articles that most closely match the query)
$max 10 Set the maximum number of articles returned per query. 100 is the maximum value. The maximum value allowed depend on your plan (FREE has 10, PLUS has 30 and PRO has 100).
$country gr Set the country of returned articles. See countries list in config file.
$lang el Set the language of returned articles. See languages list in config file.

Get Countries

Returns an array of allowed countries

Get Languages

Returns an array of allowed languages

Get Topics

Returns an array of allowed topics

Get SortBy

Returns an array of allowed sorts

CONTRIBUTORS

This package is authored by George Tsachrelias.

TODO


All versions of gnews-api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
guzzlehttp/guzzle Version ^6.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gt-tech/gnews-api contains the following files

Loading the files please wait ....