Download the PHP package tigusigalpa/coingecko-php without Composer
On this page you can find all versions of the php package tigusigalpa/coingecko-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tigusigalpa/coingecko-php
More information about tigusigalpa/coingecko-php
Files in tigusigalpa/coingecko-php
Package coingecko-php
Short Description A PHP/Laravel package for CoinGecko API integration with support for core REST endpoint groups, markets, contracts, and WebSocket subscription helpers.
License MIT
Informations about the package coingecko-php
CoinGecko Client/SDK/Library for PHP and Laravel

One small client for the parts of the CoinGecko API you use most: prices, markets, historical charts, exchanges, NFTs, public treasuries, and WebSocket subscription messages. It works in a plain PHP app and feels at home in Laravel.
Responses are returned as arrays on purpose. CoinGecko adds fields regularly, so you can use newly available response data without waiting for an SDK update.
Examples
Why use it?
- Clear, grouped methods such as
simple()->price()andcoins()->markets(). - Demo and Pro API key handling, with Laravel auto-discovery, configuration and facade support.
- A configurable Guzzle client, a sensible 30-second default timeout, and actionable API exceptions.
- WebSocket message builders for the CoinGecko protocol. They build messages; bring your own WebSocket connection.
Requirements
- PHP 8.0 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x (for Laravel integration)
- Guzzle HTTP client 7.x
Install
Install it with Composer:
Laravel setup
Laravel discovers the service provider automatically. Publish the config only
when you want to control the key, API tier or timeout from .env:
Set COINGECKO_IS_PRO=true for a paid Pro API key. Keep API keys on the
server; do not expose them in browser code.
Quick start
Plain PHP
Laravel
Common tasks
Cache a price in Laravel
CoinGecko data changes at different intervals depending on the endpoint and plan. Caching prevents duplicate work during a busy request and helps stay inside your rate limit.
Build a small market widget
Handle a failed request
Search before saving a coin ID
Names and ticker symbols are not unique, so let a person choose from CoinGecko's matches before storing an ID in a watchlist or portfolio.
API reference
The client is split into small API groups:
- Simple API - Quick price lookups and supported currencies
- Coins API - Comprehensive coin data, markets, and historical charts
- Contract API - Token data by contract address
- Asset Platforms API - Asset platforms and token lists
- Categories API - Coin categories with market data
- Exchanges API - Exchange data, tickers, and volume charts
- Derivatives API - Derivatives tickers and exchanges
- Entities API - Crypto treasury holdings and transactions
- NFTs API - NFT collections and market data
- Exchange Rates API - BTC-to-currency exchange rates
- Search API - Search queries and trending data
- Global API - Global crypto and DeFi market data
- WebSocket API - Real-time WebSocket subscriptions
- Ping API - Server status and API usage
Simple API
Get cryptocurrency prices and basic market data quickly.
Get Coin Prices
Get Token Prices by Contract Address
Get Supported Currencies
Coins API
Access detailed coin information, market data, and historical charts.
List All Coins
Top Gainers & Losers
Recently Added Coins
Coins Market Data
Detailed Coin Data
Coin Tickers
Historical Data
Market Chart Data
OHLC Chart Data
Supply Charts
Contract API
Get token data using contract addresses on various blockchain platforms.
Get Token Data by Contract Address
Token Market Chart by Contract
Asset Platforms API
Get information about blockchain platforms and their tokens.
Get Asset Platforms List
Get Token Lists by Platform
Categories API
Access cryptocurrency categories and their market data.
Get Categories List (ID Map)
Get Categories with Market Data
Exchanges API
Access exchange data, tickers, and volume information.
Get Exchanges List with Data
Get Exchanges List (ID Map)
Get Exchange Data by ID
Get Exchange Tickers
Get Exchange Volume Chart
Derivatives API
Access derivatives market data and exchanges.
Get Derivatives Tickers
Get Derivatives Exchanges
Get Derivatives Exchange by ID
Get Derivatives Exchanges List (ID Map)
Entities API
Access crypto treasury holdings and transaction history.
Get Entities List (ID Map)
Get Crypto Treasury Holdings by Coin ID
Get Crypto Treasury Holdings by Entity ID
Get Treasury Historical Chart
Get Treasury Transaction History
NFTs API
Access NFT collections and market data.
Get NFTs List (ID Map)
Get NFT Collection Data by ID
Get NFT Collection by Contract Address
Get NFTs List with Market Data
Get NFT Collection Market Chart
Get NFT Collection Tickers
Exchange Rates API
Get BTC-to-currency exchange rates.
Get BTC Exchange Rates
Search API
Search for coins, exchanges, and categories, and get trending data.
Search Queries
Get Trending Search List
Global API
Access global cryptocurrency and DeFi market data.
Get Crypto Global Market Data
Get Global DeFi Market Data
Get Global Market Cap Chart
WebSocket API
Helpers for constructing real-time WebSocket subscription messages. WebSocket
access requires a paid CoinGecko plan and a WebSocket client that supplies your
Pro API key securely (prefer the x-cg-pro-api-key connection header).
Get WebSocket URL
Subscribe to a Channel
Create Simple Price Subscription
Create Onchain Token Price Subscription
Create Onchain Trade Subscription
Create Onchain OHLCV Subscription
Unsubscribe
Ping API
Check API server status and monitor your API usage.
Check Server Status
Check API Usage (Pro API only)
Examples
Practical use cases
Portfolio Tracker
Price Alert System
Market Analysis Dashboard
Historical Price Comparison
DeFi Token Tracker
Configuration and production notes
Use your own Guzzle client
Error Handling
Rate limits and caching
Limits vary by CoinGecko plan and endpoint, so check the current allowance in
your CoinGecko account rather than relying on a hard-coded number. This package
does not queue or retry requests automatically. Cache repeated reads and use
queue backoff for background work when you receive a 429 response.
Testing
Contributing
Bug reports, documentation improvements and pull requests are welcome. Please keep a change focused, add or update a test when behaviour changes, and run the test suite before opening a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Igor Sazonov
- CoinGecko for providing the API
- All contributors
Links
- Package : https://packagist.org/packages/tigusigalpa/coingecko-php
- Repository: https://github.com/tigusigalpa/coingecko-php
- CoinGecko API Documentation: https://docs.coingecko.com
- CoinGecko Website: https://www.coingecko.com
All versions of coingecko-php with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0