coingecko-api
coingecko-api copied to clipboard
Having an issue with GuzzleHTTP
Hello, i'm getting an error when i use this client.
Uncaught Error: Class 'GuzzleHttp\Client' not found in C:\xampp\htdocs\crypto\coingecko_client\src\CoinGeckoClient.php:39
Please help me to solve this Thank you
Hello, please install package by composer I hope this helped solve your problem.
Still i'm facing the same issue...
Sounds like you're wanting to use this as a standalone package (not integrated in your own project) and here's one simple way to do that (examples are geared towards macOS/Linux users but hopefully demonstrate the general idea for Windows too):
-
Create a new directory and cd into it e.g.,
mkdir somedir && cd somedir -
Create an empty object composer.json file e.g.,
echo "{}" > composer.json -
Now install it using composer e.g.,
composer require codenix-sv/coingecko-api -
Create a new file that uses autoloading e.g.,
echo "<?php require 'vendor/autoload.php';" > test.php -
Now, under that, execute some code... but ensure your require
vendor/autoload.phpis present first as it magically loads the appropriate classes e.g.,
<?php
require 'vendor/autoload.php';
use Codenixsv\CoinGeckoApi\CoinGeckoClient;
$client = new CoinGeckoClient();
$data = $client->ping();
print_r($data);
Hopefully the output is:
Array
(
[gecko_says] => (V3) To the Moon!
)