├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── index.php ├── option.json ├── options.php ├── post.php └── src └── BinanceApi └── Binance.php /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Nguyen Hoang Minh Hung 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Binance P2P API 3 | 4 |  5 | 6 | API get all ads price of any crypto-asset in fiatcurrency on Binance's p2p exchange 7 | 8 | 9 | ## ⚡ Demo 10 | 11 |  12 | ## ⚡ Installation 13 | 14 | Install guzzlehttp 15 | 16 | ```bash 17 | composer require guzzlehttp/guzzle 18 | ``` 19 | Install monolog 20 | 21 | ```bash 22 | composer monolog/monolog 23 | ``` 24 | ## ⚡ API Reference 25 | 26 | ```http 27 | get value in options.php 28 | ``` 29 | 30 | ```http 31 | GET /post.php 32 | ``` 33 | 34 | | Parameter | Type | Description | 35 | | :-------- | :------- | :------------------------- | 36 | | `asset` | `string` | **Required**. | 37 | | `fiat` | `string` | **Required**. | 38 | | `tradeType` | `string` | **Required**. | 39 | 40 | 41 | ## ⚡ Authors 42 | 43 | - [@1412dev](https://www.facebook.com/1412.dev) 44 | 45 | 46 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1412dev/binance_p2p_api", 3 | "description": "Binance P2P Api", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "1412dev", 8 | "email": "me@1412.io" 9 | } 10 | ], 11 | "require": { 12 | "guzzlehttp/guzzle": "^7.3", 13 | "monolog/monolog": "^2.2" 14 | }, 15 | "autoload": { 16 | "psr-4": { 17 | "API\\": "src" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "665c1d7a15a19bdd9d81678f11fbbf59", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/guzzle", 11 | "version": "7.3.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/guzzle.git", 15 | "reference": "7008573787b430c1c1f650e3722d9bba59967628" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", 20 | "reference": "7008573787b430c1c1f650e3722d9bba59967628", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "ext-json": "*", 25 | "guzzlehttp/promises": "^1.4", 26 | "guzzlehttp/psr7": "^1.7 || ^2.0", 27 | "php": "^7.2.5 || ^8.0", 28 | "psr/http-client": "^1.0" 29 | }, 30 | "provide": { 31 | "psr/http-client-implementation": "1.0" 32 | }, 33 | "require-dev": { 34 | "bamarni/composer-bin-plugin": "^1.4.1", 35 | "ext-curl": "*", 36 | "php-http/client-integration-tests": "^3.0", 37 | "phpunit/phpunit": "^8.5.5 || ^9.3.5", 38 | "psr/log": "^1.1" 39 | }, 40 | "suggest": { 41 | "ext-curl": "Required for CURL handler support", 42 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 43 | "psr/log": "Required for using the Log middleware" 44 | }, 45 | "type": "library", 46 | "extra": { 47 | "branch-alias": { 48 | "dev-master": "7.3-dev" 49 | } 50 | }, 51 | "autoload": { 52 | "psr-4": { 53 | "GuzzleHttp\\": "src/" 54 | }, 55 | "files": [ 56 | "src/functions_include.php" 57 | ] 58 | }, 59 | "notification-url": "https://packagist.org/downloads/", 60 | "license": [ 61 | "MIT" 62 | ], 63 | "authors": [ 64 | { 65 | "name": "Michael Dowling", 66 | "email": "mtdowling@gmail.com", 67 | "homepage": "https://github.com/mtdowling" 68 | }, 69 | { 70 | "name": "Márk Sági-Kazár", 71 | "email": "mark.sagikazar@gmail.com", 72 | "homepage": "https://sagikazarmark.hu" 73 | } 74 | ], 75 | "description": "Guzzle is a PHP HTTP client library", 76 | "homepage": "http://guzzlephp.org/", 77 | "keywords": [ 78 | "client", 79 | "curl", 80 | "framework", 81 | "http", 82 | "http client", 83 | "psr-18", 84 | "psr-7", 85 | "rest", 86 | "web service" 87 | ], 88 | "support": { 89 | "issues": "https://github.com/guzzle/guzzle/issues", 90 | "source": "https://github.com/guzzle/guzzle/tree/7.3.0" 91 | }, 92 | "funding": [ 93 | { 94 | "url": "https://github.com/GrahamCampbell", 95 | "type": "github" 96 | }, 97 | { 98 | "url": "https://github.com/Nyholm", 99 | "type": "github" 100 | }, 101 | { 102 | "url": "https://github.com/alexeyshockov", 103 | "type": "github" 104 | }, 105 | { 106 | "url": "https://github.com/gmponos", 107 | "type": "github" 108 | } 109 | ], 110 | "time": "2021-03-23T11:33:13+00:00" 111 | }, 112 | { 113 | "name": "guzzlehttp/promises", 114 | "version": "1.4.1", 115 | "source": { 116 | "type": "git", 117 | "url": "https://github.com/guzzle/promises.git", 118 | "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" 119 | }, 120 | "dist": { 121 | "type": "zip", 122 | "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", 123 | "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", 124 | "shasum": "" 125 | }, 126 | "require": { 127 | "php": ">=5.5" 128 | }, 129 | "require-dev": { 130 | "symfony/phpunit-bridge": "^4.4 || ^5.1" 131 | }, 132 | "type": "library", 133 | "extra": { 134 | "branch-alias": { 135 | "dev-master": "1.4-dev" 136 | } 137 | }, 138 | "autoload": { 139 | "psr-4": { 140 | "GuzzleHttp\\Promise\\": "src/" 141 | }, 142 | "files": [ 143 | "src/functions_include.php" 144 | ] 145 | }, 146 | "notification-url": "https://packagist.org/downloads/", 147 | "license": [ 148 | "MIT" 149 | ], 150 | "authors": [ 151 | { 152 | "name": "Michael Dowling", 153 | "email": "mtdowling@gmail.com", 154 | "homepage": "https://github.com/mtdowling" 155 | } 156 | ], 157 | "description": "Guzzle promises library", 158 | "keywords": [ 159 | "promise" 160 | ], 161 | "support": { 162 | "issues": "https://github.com/guzzle/promises/issues", 163 | "source": "https://github.com/guzzle/promises/tree/1.4.1" 164 | }, 165 | "time": "2021-03-07T09:25:29+00:00" 166 | }, 167 | { 168 | "name": "guzzlehttp/psr7", 169 | "version": "1.8.2", 170 | "source": { 171 | "type": "git", 172 | "url": "https://github.com/guzzle/psr7.git", 173 | "reference": "dc960a912984efb74d0a90222870c72c87f10c91" 174 | }, 175 | "dist": { 176 | "type": "zip", 177 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", 178 | "reference": "dc960a912984efb74d0a90222870c72c87f10c91", 179 | "shasum": "" 180 | }, 181 | "require": { 182 | "php": ">=5.4.0", 183 | "psr/http-message": "~1.0", 184 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 185 | }, 186 | "provide": { 187 | "psr/http-message-implementation": "1.0" 188 | }, 189 | "require-dev": { 190 | "ext-zlib": "*", 191 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" 192 | }, 193 | "suggest": { 194 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 195 | }, 196 | "type": "library", 197 | "extra": { 198 | "branch-alias": { 199 | "dev-master": "1.7-dev" 200 | } 201 | }, 202 | "autoload": { 203 | "psr-4": { 204 | "GuzzleHttp\\Psr7\\": "src/" 205 | }, 206 | "files": [ 207 | "src/functions_include.php" 208 | ] 209 | }, 210 | "notification-url": "https://packagist.org/downloads/", 211 | "license": [ 212 | "MIT" 213 | ], 214 | "authors": [ 215 | { 216 | "name": "Michael Dowling", 217 | "email": "mtdowling@gmail.com", 218 | "homepage": "https://github.com/mtdowling" 219 | }, 220 | { 221 | "name": "Tobias Schultze", 222 | "homepage": "https://github.com/Tobion" 223 | } 224 | ], 225 | "description": "PSR-7 message implementation that also provides common utility methods", 226 | "keywords": [ 227 | "http", 228 | "message", 229 | "psr-7", 230 | "request", 231 | "response", 232 | "stream", 233 | "uri", 234 | "url" 235 | ], 236 | "support": { 237 | "issues": "https://github.com/guzzle/psr7/issues", 238 | "source": "https://github.com/guzzle/psr7/tree/1.8.2" 239 | }, 240 | "time": "2021-04-26T09:17:50+00:00" 241 | }, 242 | { 243 | "name": "monolog/monolog", 244 | "version": "2.2.0", 245 | "source": { 246 | "type": "git", 247 | "url": "https://github.com/Seldaek/monolog.git", 248 | "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" 249 | }, 250 | "dist": { 251 | "type": "zip", 252 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", 253 | "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", 254 | "shasum": "" 255 | }, 256 | "require": { 257 | "php": ">=7.2", 258 | "psr/log": "^1.0.1" 259 | }, 260 | "provide": { 261 | "psr/log-implementation": "1.0.0" 262 | }, 263 | "require-dev": { 264 | "aws/aws-sdk-php": "^2.4.9 || ^3.0", 265 | "doctrine/couchdb": "~1.0@dev", 266 | "elasticsearch/elasticsearch": "^7", 267 | "graylog2/gelf-php": "^1.4.2", 268 | "mongodb/mongodb": "^1.8", 269 | "php-amqplib/php-amqplib": "~2.4", 270 | "php-console/php-console": "^3.1.3", 271 | "phpspec/prophecy": "^1.6.1", 272 | "phpstan/phpstan": "^0.12.59", 273 | "phpunit/phpunit": "^8.5", 274 | "predis/predis": "^1.1", 275 | "rollbar/rollbar": "^1.3", 276 | "ruflin/elastica": ">=0.90 <7.0.1", 277 | "swiftmailer/swiftmailer": "^5.3|^6.0" 278 | }, 279 | "suggest": { 280 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 281 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 282 | "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", 283 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 284 | "ext-mbstring": "Allow to work properly with unicode symbols", 285 | "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", 286 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 287 | "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", 288 | "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", 289 | "php-console/php-console": "Allow sending log messages to Google Chrome", 290 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 291 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server" 292 | }, 293 | "type": "library", 294 | "extra": { 295 | "branch-alias": { 296 | "dev-main": "2.x-dev" 297 | } 298 | }, 299 | "autoload": { 300 | "psr-4": { 301 | "Monolog\\": "src/Monolog" 302 | } 303 | }, 304 | "notification-url": "https://packagist.org/downloads/", 305 | "license": [ 306 | "MIT" 307 | ], 308 | "authors": [ 309 | { 310 | "name": "Jordi Boggiano", 311 | "email": "j.boggiano@seld.be", 312 | "homepage": "https://seld.be" 313 | } 314 | ], 315 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 316 | "homepage": "https://github.com/Seldaek/monolog", 317 | "keywords": [ 318 | "log", 319 | "logging", 320 | "psr-3" 321 | ], 322 | "support": { 323 | "issues": "https://github.com/Seldaek/monolog/issues", 324 | "source": "https://github.com/Seldaek/monolog/tree/2.2.0" 325 | }, 326 | "funding": [ 327 | { 328 | "url": "https://github.com/Seldaek", 329 | "type": "github" 330 | }, 331 | { 332 | "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", 333 | "type": "tidelift" 334 | } 335 | ], 336 | "time": "2020-12-14T13:15:25+00:00" 337 | }, 338 | { 339 | "name": "psr/http-client", 340 | "version": "1.0.1", 341 | "source": { 342 | "type": "git", 343 | "url": "https://github.com/php-fig/http-client.git", 344 | "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" 345 | }, 346 | "dist": { 347 | "type": "zip", 348 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 349 | "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 350 | "shasum": "" 351 | }, 352 | "require": { 353 | "php": "^7.0 || ^8.0", 354 | "psr/http-message": "^1.0" 355 | }, 356 | "type": "library", 357 | "extra": { 358 | "branch-alias": { 359 | "dev-master": "1.0.x-dev" 360 | } 361 | }, 362 | "autoload": { 363 | "psr-4": { 364 | "Psr\\Http\\Client\\": "src/" 365 | } 366 | }, 367 | "notification-url": "https://packagist.org/downloads/", 368 | "license": [ 369 | "MIT" 370 | ], 371 | "authors": [ 372 | { 373 | "name": "PHP-FIG", 374 | "homepage": "http://www.php-fig.org/" 375 | } 376 | ], 377 | "description": "Common interface for HTTP clients", 378 | "homepage": "https://github.com/php-fig/http-client", 379 | "keywords": [ 380 | "http", 381 | "http-client", 382 | "psr", 383 | "psr-18" 384 | ], 385 | "support": { 386 | "source": "https://github.com/php-fig/http-client/tree/master" 387 | }, 388 | "time": "2020-06-29T06:28:15+00:00" 389 | }, 390 | { 391 | "name": "psr/http-message", 392 | "version": "1.0.1", 393 | "source": { 394 | "type": "git", 395 | "url": "https://github.com/php-fig/http-message.git", 396 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 397 | }, 398 | "dist": { 399 | "type": "zip", 400 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 401 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 402 | "shasum": "" 403 | }, 404 | "require": { 405 | "php": ">=5.3.0" 406 | }, 407 | "type": "library", 408 | "extra": { 409 | "branch-alias": { 410 | "dev-master": "1.0.x-dev" 411 | } 412 | }, 413 | "autoload": { 414 | "psr-4": { 415 | "Psr\\Http\\Message\\": "src/" 416 | } 417 | }, 418 | "notification-url": "https://packagist.org/downloads/", 419 | "license": [ 420 | "MIT" 421 | ], 422 | "authors": [ 423 | { 424 | "name": "PHP-FIG", 425 | "homepage": "http://www.php-fig.org/" 426 | } 427 | ], 428 | "description": "Common interface for HTTP messages", 429 | "homepage": "https://github.com/php-fig/http-message", 430 | "keywords": [ 431 | "http", 432 | "http-message", 433 | "psr", 434 | "psr-7", 435 | "request", 436 | "response" 437 | ], 438 | "support": { 439 | "source": "https://github.com/php-fig/http-message/tree/master" 440 | }, 441 | "time": "2016-08-06T14:39:51+00:00" 442 | }, 443 | { 444 | "name": "psr/log", 445 | "version": "1.1.4", 446 | "source": { 447 | "type": "git", 448 | "url": "https://github.com/php-fig/log.git", 449 | "reference": "d49695b909c3b7628b6289db5479a1c204601f11" 450 | }, 451 | "dist": { 452 | "type": "zip", 453 | "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", 454 | "reference": "d49695b909c3b7628b6289db5479a1c204601f11", 455 | "shasum": "" 456 | }, 457 | "require": { 458 | "php": ">=5.3.0" 459 | }, 460 | "type": "library", 461 | "extra": { 462 | "branch-alias": { 463 | "dev-master": "1.1.x-dev" 464 | } 465 | }, 466 | "autoload": { 467 | "psr-4": { 468 | "Psr\\Log\\": "Psr/Log/" 469 | } 470 | }, 471 | "notification-url": "https://packagist.org/downloads/", 472 | "license": [ 473 | "MIT" 474 | ], 475 | "authors": [ 476 | { 477 | "name": "PHP-FIG", 478 | "homepage": "https://www.php-fig.org/" 479 | } 480 | ], 481 | "description": "Common interface for logging libraries", 482 | "homepage": "https://github.com/php-fig/log", 483 | "keywords": [ 484 | "log", 485 | "psr", 486 | "psr-3" 487 | ], 488 | "support": { 489 | "source": "https://github.com/php-fig/log/tree/1.1.4" 490 | }, 491 | "time": "2021-05-03T11:20:27+00:00" 492 | }, 493 | { 494 | "name": "ralouphie/getallheaders", 495 | "version": "3.0.3", 496 | "source": { 497 | "type": "git", 498 | "url": "https://github.com/ralouphie/getallheaders.git", 499 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 500 | }, 501 | "dist": { 502 | "type": "zip", 503 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 504 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 505 | "shasum": "" 506 | }, 507 | "require": { 508 | "php": ">=5.6" 509 | }, 510 | "require-dev": { 511 | "php-coveralls/php-coveralls": "^2.1", 512 | "phpunit/phpunit": "^5 || ^6.5" 513 | }, 514 | "type": "library", 515 | "autoload": { 516 | "files": [ 517 | "src/getallheaders.php" 518 | ] 519 | }, 520 | "notification-url": "https://packagist.org/downloads/", 521 | "license": [ 522 | "MIT" 523 | ], 524 | "authors": [ 525 | { 526 | "name": "Ralph Khattar", 527 | "email": "ralph.khattar@gmail.com" 528 | } 529 | ], 530 | "description": "A polyfill for getallheaders.", 531 | "support": { 532 | "issues": "https://github.com/ralouphie/getallheaders/issues", 533 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 534 | }, 535 | "time": "2019-03-08T08:55:37+00:00" 536 | } 537 | ], 538 | "packages-dev": [], 539 | "aliases": [], 540 | "minimum-stability": "stable", 541 | "stability-flags": [], 542 | "prefer-stable": false, 543 | "prefer-lowest": false, 544 | "platform": [], 545 | "platform-dev": [], 546 | "plugin-api-version": "2.0.0" 547 | } 548 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 5 | * @site https://1412.dev 6 | * @date 5/22/21, 5:120 AM 7 | * Please don't edit, respect me, if you want to be appreciated. 8 | */ 9 | require_once('options.php'); 10 | ?> 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 |