Download the PHP package flerex/spain-gas without Composer

On this page you can find all versions of the php package flerex/spain-gas. 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 spain-gas

Spain Gas

Header Packagist Version Total Downloads

Spain Gas is a PHP client that act as a wrapper around Spain's Geoportal Gasolineras API. It has the following main features:

Requirements

Installation

To install this package be sure to have composer installed and run the following command in your project's directory:

Usage

All the API's endpoints are available by using the GasApi class. Currently, there are only two endpoints for the API:

NOTE: All the aforementioned endpoints will provide the price of the fuel if specified by using the query filter fuel. Otherwise, it will always return null.

Every endpoint returns an instance of a Builder class, which provides methods to filter the request to be made. Once you selected your filtering parameters, a call to method get is required to actually run the request and retrieve the data.

In case you need more information about what filters are available check the Documentation.

Endpoints

Here is a list of all available endpoints, and the differences in the data retrieved. Endpoint Documentation Ranking Prices Geographical Location Station Information Town ID
gasStations Wiki :heavy_multiplication_x: :heavy_check_mark: * :heavy_check_mark: :heavy_check_mark: :heavy_multiplication_x:
locateGasStations Wiki :heavy_check_mark: * :heavy_check_mark: * :heavy_check_mark: :heavy_multiplication_x: :heavy_multiplication_x:
towns Wiki :heavy_multiplication_x: :heavy_multiplication_x: :heavy_multiplication_x: :heavy_multiplication_x: :heavy_check_mark:

* Only returned when filtering by fuel.

Example

Obtain Stations by Fuel

Here is an example where we are retrieving all CNG gas stations in Spain:

Get specific town ID

Let us suppose we needed to obtain all gas stations in A Coruña (city). To be able to filter by town in the gasStations endpoint, we will first need to retrieve the ID of the town.

Get the price ranking

Price rankings are used to categorize the price of some fuel in a gas station comparing it to their competitors. The algorithm used by the API is unknown.

Unfortunately, rankings are only available in the locateGasStations endpoints.

In the following example we are going to retrieve the cheapest self-service gas stations.

NOTE: We need to specify a fuel so that rankings are provided in return.

Changelog

Changelog can be found in releases.

Copyright and License

Spain Gas was written by Flerex and is released under the MIT License.

© Flerex 2020


All versions of spain-gas with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4||^8.0
myclabs/php-enum Version ^1.7
guzzlehttp/guzzle Version ^7.2
ext-json Version *
ext-simplexml Version *
ext-mbstring Version *
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 flerex/spain-gas contains the following files

Loading the files please wait ....