darkling / php-zomato-client
Zomato php api client
0.2
2018-12-17 19:08 UTC
Requires
- php: >=7.1
- dogma/dogma: ^0.1.10
- guzzlehttp/guzzle: ^6.0|^5.0|^4.0
- nette/http: ^2.4
Requires (Dev)
- consistence/coding-standard: ^3.0
- nette/tester: ^2.1
- phpstan/phpstan: ^0.10
- phpstan/phpstan-strict-rules: ^0.10
- slevomat/coding-standard: ^4.0
This package is auto-updated.
Last update: 2024-11-18 08:11:07 UTC
README
Zomato api client written in PHP. Supports Zomato APIv2.1.
Installation
Just use composer.
composer require darkling/php-zomato-client
Usage
// Create request $request = new RestaurantRequest(16506740); // restaurant ID // OR //$request = RestaurantRequest::createFromParameters(['res_id' => 16506740]); // Name of parameters must respect name of parameters in zomato api documentation // Create client // You can choose from three possible output options (JSON_STRING, JSON_ARRAY, JSON_STD_CLASS) $client = new ZomatoClient('userApiKey', ResponseOption::get(ResponseOption::JSON_STRING)); // Send request and get response $response = $client->send($request); // Handle response if ($response->isOk()) { var_dump($response->getData()); } else { var_dump($response->getStatusCode()); var_dump($response->getReasonPhrase()); }
Requests
List of available requests:
- /categories Get list of Categories -> Not implemented
- /cities Get city details -> Not implemented
- /collections Get Zomato collections in a city -> Not implemented
- /cuisines Get list of all cuisines in a city -> Not implemented
- /establishments Get list of restaurant types in a city -> Not implemented
- /geocode Get location details based on coordinates -> Not implemented
- /location_details Get Zomato location details -> Not implemented
- /locations Search for locations -> Not implemented
- /dailymenu Get daily menu of a restaurant -> DailyMenuRequest
- /restaurant Get restaurant details -> RestaurantRequest
- /reviews Get restaurant reviews -> ReviewsRequest
- /search Search for restaurants -> SearchRequest
If you need to use some of the request which is not currently implemented, you are welcome to send PR :-)
Nette
If you are looking for integration to Nette Framework just use this package daaarkling/nette-zomato-client.
Licence
New BSD License