Download the PHP package vinaykevadia/similarweb-api without Composer

On this page you can find all versions of the php package vinaykevadia/similarweb-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 similarweb-api

SimilarWeb API PHP Client

Build Status SensioLabsInsight License Latest Stable Version Dependency Status Scrutinizer Code Quality Code Coverage Code Climate

Introduction

SimilarWeb is a project created by SimilarGroup company. It collects and provides access to various website analytics. This is a PHP library implementing easy access to their API.

If you want to know what changed in each version please refer to CHANGELOG file in the root of this repository.

Requirements:

Installation:

This library is available on Packagist and uses thunderer/similarweb-api alias. If you use Composer (and if you don't I don't know what you're waiting for) you can composer require it:

Alternatively you can place it manually inside your composer.json:

and then run composer install or composer update as required.

This library requires Request and Response classes generated from its configuration. If you're using Composer please add proper entries to "scripts" block to composer.json file like in the example below to have them generated automatically during install or update. In any other case please manually run php bin/generate from command line. You can read more on this topic in Internals section.

Utility class ClientFacade containing easy to use interface is also generated just after Request and Response classes.

You can of course make it a git submodule, download and place it in your project next to your regular code or something, but really, do yourself (and the whole industry) a favor and use Composer.

Usage:

All APIs implemented in this library have the Request and Response classes named corresponding to those defined in SimilarWeb API documentation. Expected data should be retrieved by first visiting SimilarWeb API documentation and then using Request class with the same name located in src/Request directory. Method getResponse() demonstrated below will automatically match, create and return matching Response class object which can be type hinted and relied on. There is also ClientFacade class which contains easy to use interface (note that this class is auto-generated):

Internals

The core of this library is a file called mapping.yaml which contains definition of data returned by each API. This library requires existence of Request and Response classes generated using bin/generate script from data stored in that file. In this section API GlobalRank will be described and referred to as an example. This is its mapping configuration:

It states that there is an API named GlobalRank which uses URL part globalRank and returns one value which library will refer to as rank, reading it either from JSON key Rank or XML element Rank. From such configuration bin/generate script will create two classes: Thunder\SimilarWebApi\Request\GlobalRank and Thunder\SimilarWebApi\Response\GlobalRank which are used respectively as input and output objects passed to and returned from Thunder\SimilarWebApi\Client::getResponse() method.

APIs return associative arrays with keys containing four types of data:

During either composer install, composer update or manual execution of php bin/generate command, API mapping configuration is used to generate domain request and response classes with methods hiding library complexity behind readable accessors. Such approach makes it possible to have readable class API, good IDE autocompletion and highlighting possibilities with no additional programming work. When response is parsed all elements of given type are put inside their containers and those response classes act as a facade for raw response object.

License

See LICENSE file in the root of this repository.


All versions of similarweb-api with dependencies

PHP Build Version
Package Version
Requires symfony/yaml Version ^2.3|^3.0
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 vinaykevadia/similarweb-api contains the following files

Loading the files please wait ....