Actor picture

Binance Top Traders Future Positions

selcukitmis/binance-top-traders-positions

Binance is the world's largest crypto exchange. On Binance Leaderboard, you can see the current future positions of the traders with the highest monthly earnings and the most followers.

No credit card required

Author's avatarSelçuk İtmiş
  • Modified
  • Users162
  • Runs21,498
Actor picture
Binance Top Traders Future Positions

.editorconfig

root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

.eslintrc

{
    "extends": "@apify"
}

.gitignore

# This file tells Git which files shouldn't be added to source control

.idea
node_modules

Dockerfile

# First, specify the base Docker image. You can read more about
# the available images at https://sdk.apify.com/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node:16

# Second, copy just package.json and package-lock.json since it should be
# the only file that affects "npm install" in the next step, to speed up the build
COPY package*.json ./

# Install NPM packages, skip optional and development dependencies to
# keep the image small. Avoid logging too much and print the dependency
# tree for debugging
RUN npm --quiet set progress=false \
 && npm install --only=prod --no-optional \
 && echo "Installed NPM packages:" \
 && (npm list --only=prod --no-optional --all || true) \
 && echo "Node.js version:" \
 && node --version \
 && echo "NPM version:" \
 && npm --version

# Next, copy the remaining files and directories with the source code.
# Since we do this after NPM install, quick build will be really fast
# for most source file changes.
COPY . ./

# Optionally, specify how to launch the source code of your actor.
# By default, Apify's base Docker images define the CMD instruction
# that runs the Node.js source code using the command specified
# in the "scripts.start" section of the package.json file.
# In short, the instruction looks something like this:
#
# CMD npm start

INPUT_SCHEMA.json

{
    "title": "Input schema for the apify_project actor.",
    "type": "object",
    "schemaVersion": 1,
    "properties": {

    },
    "required": []
}

README.md

# Binance Top Traders Future Positions

Binance is the world's largest crypto exchange.

On Binance Leaderboard, you can see the current future positions of the traders with the highest monthly earnings and the most followers.

The current positions of these people can help you while trading.

- [Binance Leaderboard](https://www.binance.com/en/futures-activity/leaderboard)
- [Binance Leaderboard Monthly Top Traders](https://www.binance.com/en/futures-activity/leaderboard?type=filterResults&isShared=true&tradeType=PERPETUAL&symbol=&periodType=MONTHLY&roiGainType=&pnlGainType=&sortType=ROI&limit=200)
- [Binance Leaderboard Most Following Traders](https://www.binance.com/en/futures-activity/leaderboard?type=filterResults&isShared=true&tradeType=PERPETUAL&symbol=&periodType=ALL&roiGainType=&pnlGainType=&sortType=FOLLOWERS&limit=200)

apify.json

{
    "env": { "npm_config_loglevel": "silent" }
}

main.js

This file is 109 lines long. Only the first 50 are shown. Show all

const Apify = require('apify');
const axios = require('axios');
const moment = require('moment');
const lodash = require('lodash');
Apify.main(async () => {
    let positions = [];
    try {
        var config = {
            method: 'post',
            url: 'https://www.binance.com/bapi/futures/v1/public/future/leaderboard/getOtherPosition',
            headers: {
                'authority': 'www.binance.com',
                'accept': '*/*',
                'accept-language': 'tr,en;q=0.9,tr-TR;q=0.8',
                'clienttype': 'web',    
                'content-type': 'application/json',
                'lang': 'en',
                'origin': 'https://www.binance.com',
                'referer': 'https://www.binance.com/en/futures-activity/leaderboard?type=myProfile&encryptedUid=EE0CE3F95107DE82428E8744053E85D3',
                'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"',
                'sec-ch-ua-mobile': '?0',
                'sec-ch-ua-platform': '"Windows"',
                'sec-fetch-dest': 'empty',
                'sec-fetch-mode': 'cors',
                'sec-fetch-site': 'same-origin',
                'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36',
                'Cookie': 'cid=4C4kmgsb'
            },
            data: "{}"
        };
        const tradersConfig = config;
        tradersConfig.data = {
            "limit": 50,
            "sortType": "ROI",
            "isShared": true,
            "periodType": "MONTHLY",
            "pnlGainType": null,
            "roiGainType": null,
            "symbol": "",
            "tradeType": "PERPETUAL"
        };
        tradersConfig.url = "https://www.binance.com/bapi/futures/v1/public/future/leaderboard/searchLeaderboard";
        const tradersData = await axios(config);

        const allRequests = [];
        const traders = [];
        if (tradersData && tradersData.data && tradersData.data.data && tradersData.data.data.length > 0) {
            tradersData.data.data.forEach(async (trader) => {
                const roi = trader.roiValue * 100;
                if (trader.followerCount > 20 && roi > 100) {

package.json

{
    "name": "project-empty",
    "version": "0.0.1",
    "description": "This is a boilerplate of an Apify actor.",
    "dependencies": {
       "apify": "^2.0.7",
        "axios": "^0.26.1",
        "lodash": "^4.17.21",
        "moment": "^2.29.3"
    },
    "devDependencies": {
        "@apify/eslint-config": "^0.1.3",
        "eslint": "^7.0.0"
    },
    "scripts": {
        "start": "node main.js",
        "lint": "./node_modules/.bin/eslint ./src --ext .js,.jsx",
        "lint:fix": "./node_modules/.bin/eslint ./src --ext .js,.jsx --fix",
        "test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
    },
    "author": "It's not you it's me",
    "license": "ISC"
}