This project is built with Laravel v10.10.0
and PHP v8.2.5
.
About the project:
Simple artisan command that fetches data from the provided Coingecko API endpoint and stores it in a database.
Coingecko API Documentation:
https://www.coingecko.com/en/api/documentation
Make sure you have PHP
and composer
installed and configured on your system.
# download/setup the project on your machine.
$ git clone https://github.com/narainsagar/coingecko_api.git
$ cd /projects/coingecko-api
# install required packages
$ composer install
# create databases and run migrations.
$ php artisan migrate
# Run the artisan command to fetch data from coingecko api and store into db.
$ php artisan fetch:coingecko
# Run the app - Check the Live API and all coins data via below mentioned API endpoints.
$ php artisan serve
$ php artisan serve
command will run the app and expose to http://127.0.0.1:8000/ address by default
You may also try below API endpoinds to see the data right in favourite web browser or API client.
GET http://127.0.0.1:8000/api/coins
GET http://127.0.0.1:8000/api/coins/{coin_id}
Sample database schema script could be found in db_schema.sql
$ php artisan fetch:coingecko
$ php artisan serve
-- GEThttp://127.0.0.1:8000/
$ php artisan serve
-- GEThttp://127.0.0.1:8000/api/coins
$ php artisan serve
-- GEThttp://127.0.0.1:8000/api/coins/0chain