X-APIKEY: YOUR_API_KEY
Terms of use and cost of the API is available on the page https://p2p.army/en/api_p2p
curl -H "X-APIKEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \ -X POST 'https://p2p.army/v1/api/get_p2p_assets' \ -d '{"market":"bybit","fiat":"EUR"}'
Where XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - your key.
https://p2p.army/v1/api/ping
{"pong":1}
curl 'https://p2p.army/v1/api/ping'
https://p2p.army/v1/api/time
{"time":1734801901}
curl 'https://p2p.army/v1/api/time'
Getting a list of P2P markets.
https://p2p.army/v1/api/get_p2p_markets
{ "rows": [ "binance", "bybit", "huobi", "okx", "bitget", "bingx", "kucoin", "mexc" ], "status": 1 }
curl 'https://p2p.army/v1/api/get_p2p_markets'
Getting a list of fiat currencies in P2P.
https://p2p.army/v1/api/get_p2p_fiats
{ "rows": [ "AED", "ALL", "AMD", "AOA", "ARS", "AUD", "AZN", "BAM", ..., "XOF", "YER", "ZAR", "ZMW" ], "status": 1 }
curl 'https://p2p.army/v1/api/get_p2p_fiats'
Receiving crypto assets in P2P.
https://p2p.army/v1/api/get_p2p_assets
curl -X POST 'https://p2p.army/v1/api/get_p2p_assets' -d '{"market":"bybit","fiat":"INR"}'
Parameter | Required | Notice |
---|---|---|
market | yes | P2P exchange, for example: binance |
fiat | yes | fiat currency, for example: EUR |
{ "assets": [ "USDT", "BTC", "ETH", "USDC" ], "status": 1 }
Parameter | Notice |
---|---|
assets | list of crypto assets |
Getting payment methods in P2P using input data: market+fiat.
https://p2p.army/v1/api/get_popular_p2p_payment_methods
curl -X POST 'https://p2p.army/v1/api/get_popular_p2p_payment_methods' -d '{"market":"bybit","fiat":"INR"}'
Parameter | Required | Notice |
---|---|---|
market | yes | P2P exchange, for example: binance |
fiat | yes | fiat currency, for example: EUR |
limit | no | output limit |
{ "payment_methods": [ { "ads_count_BUY": 193, "ads_count_SELL": 202, "ads_count_total": 395, "activity_24h": 20414, "market": "bybit", "title": "Raiffeisenbank", "payment_method": "Raiffeisenbank", "payment_method_vendor_id": 64 }, { "ads_count_BUY": 124, "ads_count_SELL": 173, "ads_count_total": 297, "activity_24h": 25717, "market": "bybit", "title": "Local Card(Green)", "payment_method": "Local Card(Green)", "payment_method_vendor_id": 582 }, ... ], "status": 1 }
Parameter | Notice |
---|---|
ads_count_BUY | Number of ads in the BUY section. |
ads_count_SELL | Number of ads in the SELL section. |
ads_count_total | Total ads. |
market | P2P exchange, for example: binance |
title | Name of payment method. |
payment_method | Payment method code. |
activity_24h | Activity for 24 hours. |
payment_method_vendor_id | ID of the payment method on the platform. (only for some) |
Getting prices on the P2P platform using input data: market+fiat+asset.
https://p2p.army/v1/api/get_p2p_prices
curl -X POST 'https://p2p.army/v1/api/get_p2p_prices' -d '{"market":"bybit","fiat":"RUB","asset":"USDT","limit":10}'
Parameter | Required | Notice |
---|---|---|
market | yes | P2P exchange, for example: bybit |
fiat | yes | fiat currency, for example: INR |
asset | yes | crypto asset, for example: USDT, BTC, ETH. |
limit | no | output limit |
{ "status": 1, "prices": [ { "payment_method": "Local Card(Yellow)", "payment_method_vendor_id": 582, "updated_BUY": 1712707049, "updated_SELL": 1712707049, "prices_BUY": [ "94.79", "95.29", "95.5", "95.8", "95.87", "95.99", "96", "96", "96", "96.1" ], "prices_SELL": [ "102.1", "96.5", "94.41", "94.38", "94.3", "94.25", "94.24", "94.21", "94.14", "94.03" ], "avg_price_BUY": 95.734, "avg_price_SELL": 95.256, "activity_24h": 19660, "ads_count_BUY": 69, "ads_count_SELL": 79, "ads_count_total": 148 }, ... ] }
Parameter | Notice |
---|---|
payment_method | Payment method code. |
payment_method_vendor_id | ID of the payment method on the platform. (only for some) |
updated_BUY | Timestamp, UTC. Time of price synchronization from the BUY section. |
updated_SELL | Timestamp, UTC. Time of price synchronization from the SELL section. |
prices_BUY | Array of TOP10 prices from the BUY section. |
prices_SELL | Array of TOP10 prices from the SELL section. |
avg_price_BUY | ***Average price from the prices_BUY array. |
avg_price_SELL | ***Average price from the prices_SELL array. |
activity_24h | Activity for 24 hours. |
ads_count_BUY | Number of ads in the BUY section. |
ads_count_SELL | Number of ads in the SELL section. |
ads_count_total | Total ads. |
***For example: when the prices in the array are 110, 92.33, 92.28, 92.25, 92.22, 92.19, then before calculating the average price 110 will be deleted because... this number differs by more than 10% from the rest.
Receiving advertisements on the P2P platform using input data: market+fiat+asset+side.
The method returns ads in a single format from all exchanges.
https://p2p.army/v1/api/get_p2p_order_book
curl -X POST 'https://p2p.army/v1/api/get_p2p_order_book' -d '{"market":"bybit","fiat":"INR","asset":"USDT","side":"BUY","payment_method":"UPI","limit":10}'
Parameter | Required | Notice |
---|---|---|
market | yes | P2P exchange, for example: bybit |
fiat | yes | fiat currency, for example: INR |
asset | yes | crypto asset, for example: USDT, BTC, ETH. |
side | yes | Section BUY or SELL. |
payment_method | no |
Payment method code from/v1/api/get_popular_p2p_payment_methods (payment_method)
ATTENTION: Each exchange has its own payment method code. |
limit | no | output limit. Default: 10 |
amount | no | filter by fiat amount |
{ "status": 1, "ads": [ { "pos": 1, "updated_at": 1712722398, "market": "bybit", "asset": "USDT", "fiat": "INR", "side": "BUY", "payment_methods": [ "UPI" ], "price": "89.94", "surplus_amount": "810.5528", "surplus_fiat": 72901.11883200001, "min_fiat": "60000", "max_fiat": "72901.11", "text": "RULES. 1. I am online 2 Your name should be same in both BYBIT ....", "user_name": "mitrc", "user_id": "61437552", "adv_id": "1777899381177700352", "user_orders": 5, "user_rate": 100, "is_merchant": 0 }, ... ] }
Parameter | Type/values | Notice |
---|---|---|
pos | int | Ad position |
updated_at | timestamp, UTC | time of receipt of advertisement |
market | string | exchange |
asset | string | crypto asset |
fiat | string | fiat currency |
side | BUY, SELL | |
payment_methods | array | List of all specified payment methods |
price | float | Price |
surplus_amount | float | Amount of crypto asset in the ad |
surplus_fiat | float | surplus_amount * price. Announcement volume in fiat. |
min_fiat | float | Min. transaction amount |
max_fiat | float | Max. transaction amount |
text | (if any) | Ad text. It is not available on all platforms. |
user_name | string | User name on the P2P exchange. |
user_id | string|bigint|user_name | User ID on the P2P exchange. The formats are completely different. |
adv_id | string|bigint | Ad ID on the P2P exchange. The formats are completely different. |
user_orders | int | Number of all orders or number of orders for the last 30 days. |
user_rate | int, 0-100 | Order completion percentage |
is_merchant | 0 || 1 | Merchant status. |
Receiving original advertisements from P2P platforms using input data: market+fiat+asset+side.
Each platform serves ads in different formats.
https://p2p.army/v1/api/get_p2p_vendor_book
curl -X POST 'https://p2p.army/v1/api/get_p2p_vendor_book' -d '{"market":"bybit","fiat":"INR","asset":"USDT","side":"BUY","limit":10}'
Parameter | Required | Notice |
---|---|---|
market | yes | P2P exchange, for example: bybit |
fiat | yes | fiat currency, for example: INR |
asset | yes | crypto asset, for example: USDT, BTC, ETH. |
side | yes | Section BUY or SELL. |
limit | no | output limit. Default: 10 |
{ "status": 1, "vendor_ads": [ { ... }, { ... }, { ... }, ... ] }
vendor_ads contains information from exchanges without filtering on our part. Each exchange has its own response format.
Obtaining statistics of P2P exchanges, which is available on the page https://p2p.army/en/p2p/markets.
https://p2p.army/v1/api/stat/p2p_markets
curl -X POST 'https://p2p.army/v1/api/stat/p2p_markets' -d '{"limit":10}'
Parameter | Required | Note |
---|---|---|
limit | no | output limit. Default is 10. |
{ "status": 1, "markets": [ { "id": 1, "name": "binance", "title": "Binance P2P", "place": 1, "activity_24h": 1624870, "ads_BUY": 9755, "ads_SELL": 24723, "ads_total": 34478, "volume_usd_BUY": "41644784.7424", "volume_usd_SELL": "139034136.9520", "volume_usd_total": "180678921.6944", "count_fiats": 119 }, ... ] }
Parameter | Notice |
---|---|
id | Internal ID of the exchange |
name | Exchange code |
title | Exchange name |
place | Place in the ranking |
activity_24h | Activity for 24 hours is the activity index from P2P.Army. This is the sum of the “number of advertisements” and the “number of changes in the volume of these advertisements” according to the specified payment method. |
ads_BUY | Number of ads in the BUY section. |
ads_SELL | Number of ads in the SELL section. |
ads_total | Total ads. |
volume_usd_BUY | Volume in $ of ads in the BUY section. The entire volume of advertisements with assets USDT, BTC, ETH is summed up. |
volume_usd_SELL | Volume in $ of ads in the SELL section. The volume of advertisements with assets USDT, BTC, ETH is “partially” summed up, but with maximum restrictions. amount: 10,000 USDT, 0.3 BTC, 5 ETH. |
volume_usd_total | volume_usd_BUY + volume_usd_SELL |
count_fiats | Number of fiat currencies represented. |
Obtaining statistics of P2P currencies, which is available on the page https://p2p.army/en/p2p/fiats.
https://p2p.army/v1/api/stat/p2p_fiats
curl -X POST 'https://p2p.army/v1/api/stat/p2p_fiats' -d '{"type":"ads_count"}'
Parameter | Required | Notice |
---|---|---|
type | yes |
Statistics type: ads_count - Number of ads BUY_ads_volume - Volume of the BUY section SELL_ads_volume - Volume of the SELL section ads_activity24h - Activity for 24 hours |
limit | no | output limit. Default is 100. |
{ "status": 1, "fiats": [ { "fiat": "USD", "points": 6431, "by_markets": { "binance": "3773", "okx": "343", "bybit": "701", "huobi": "1232", "bitget": "207", "kucoin": "175", "mexc": 0 } }, ... ] }
Parameter | Notice |
---|---|
fiat | Fiat code |
points | Sum of by_markets array values |
by_markets | Array of values by P2P exchange |
by_markets.binance | Number of values. The value type is specified by the type parameter. |
Getting P2P price history, which is available on the page https://p2p.army/en/p2p/fiats/CNY/charts/USDT.
https://p2p.army/v1/api/history/p2p_prices
curl -X POST 'https://p2p.army/v1/api/history/p2p_prices' -d '{"market":"binance","fiat":"CNY","asset":"USDT","payment_method":"Alipay","mode":"ALL","limit":10}'
Parameter | Required | Options | Notice |
---|---|---|---|
market | yes | P2P market. Example: binance | |
fiat | yes | Fiat currency. Example: CNY | |
asset | yes | Crypto asset. Example: USDT | |
payment_method | yes |
Payment method code from/v1/api/get_popular_p2p_payment_methods (payment_method)
ATTENTION: Each exchange has its own payment method code. |
|
mode | no | 24H, 7D, 1M, 3M, 6M, 1Y, ALL. | If mode is not specified, then you need to specify from_date + to_date |
from_date | no | Timestamp UTC | (if mode is not specified) Date from. Hourly details. |
to_date | no | Timestamp UTC | (if mode is not specified) Date to. Hourly details. |
period_type | no | 1H, 0-23 | Data period: by hour (1H) or by day, indicating the desired hour 1-23. Default: 1H with mode=[24H, 7D]. |
date_format | no | timestamp || datetime | Date format in response. By default datetime. |
limit | no | max. 10 000 | output limit. Default is 10. Maximum: 10000. |
{ "history": [ { "date": "2024-04-10T03:00:00.000000Z", "buy": 95.8, "buy_avg": 95.98, "sell": 95.31, "sell_avg": 95.238 }, { "date": "2024-04-10T02:00:00.000000Z", "buy": 96, "buy_avg": 96.066, "sell": 102.1, "sell_avg": 96.846 }, { "date": "2024-04-10T01:00:00.000000Z", "buy": 96, "buy_avg": 96.088, "sell": 102.1, "sell_avg": 96.832 }, ... ] }
Parameter | Notice |
---|---|
date | datetime, UTC (or timestamp if date_format was specified) |
buy | The price of the specified crypto asset using the payment method from the BUY section. |
buy_avg | Average purchase price TOP5. |
sell | The price of the specified crypto asset using the payment method from the SELL section. |
sell_avg | Average purchase price TOP5. |