Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drylikov/coinmarketcap_private_apis
Convert CoinMarketCap's private APIs to public APIs.
https://github.com/drylikov/coinmarketcap_private_apis
Last synced: 8 days ago
JSON representation
Convert CoinMarketCap's private APIs to public APIs.
- Host: GitHub
- URL: https://github.com/drylikov/coinmarketcap_private_apis
- Owner: drylikov
- License: mit
- Created: 2024-08-17T10:26:20.000Z (3 months ago)
- Default Branch: drylikov
- Last Pushed: 2024-08-17T10:29:33.000Z (3 months ago)
- Last Synced: 2024-08-17T11:36:02.998Z (3 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# coinmarketcap-private-apis
Convert CoinMarketCap's private APIs to public APIs
## Installation
Clone repo
```bash
git clone https://github.com/drylikov/coinmarketcap_private_apis.git
```Change directory
```bash
cd coinmarketcap-private-apis
```Copy `.env.example` as `.env`
```bash
cp .env.example .env
```Open `.env` and just generate a random bearer token to add to `BEARER_TOKEN` variable (will be used in requests for extra security)
```bash
vim .env
```Install dependencies for this app
```bash
yarn install
```Install dependencies for `Puppeteer`
```bash
apt install -y libasound2 libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev
```Build the app
```bash
yarn build
```Start the app with `Yarn`
```bash
yarn start
```Now APIs should be working on the URL
```bash
http://your-ip:1360/
```To run it continuously you'd like to use `PM2` or a similar process manager
```bash
# Install it if you don't have
yarn global add pm2
# Start the app with PM2
pm2 start pm2.json
# Set PM2 to be run on startups
pm2 startup
```## Usage
Make a post request to your IP address with your bearer token
```js
const axios = require('axios')const run = async () => {
const collections = await axios({
data: {
start: '0',
period: '4',
limit: '100',
desc: 'true',
sort: 'volume'
},
method: 'post',
url: 'http://your-ip:1360/api/nft/collections',
headers: {
Authorization: 'Bearer BEARER_TOKEN'
}
})console.log(collections.data)
}run()
```Results would be
```js
{
success: true,
coinmarketcap: {
data: { count: '1901', collections: [Array], blockChains: [Array] },
status: {
timestamp: '2022-03-06T19:45:08.867Z',
error_code: '0',
error_message: 'SUCCESS',
elapsed: '89',
credit_count: 0
}
}
}
```