Introduction to the API

General

  • URL: https://p2p.army/v1/api
  • Requests in the format: JSON
  • Responses in the format: JSON
  • Authorization via HTTP header:
    X-APIKEY: YOUR_API_KEY
  • In case of an error, a parameter is added to the response errText.

Prices and Terms


Terms of use and cost of the API is available on the page https://p2p.army/en/api_p2p

Example request


curl -H "X-APIKEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
    -X POST 'https://p2p.army/v1/api/get_p2p_assets' \
    -d '{"market":"bybit","fiat":"EUR"}'

Where XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - your key.

Checking API Availability

Request:
https://p2p.army/v1/api/ping
Response:
{"pong":1}
Example:
curl -X POST 'https://p2p.army/v1/api/ping'

Server time

Request:
https://p2p.army/v1/api/time
Response:
{"time":1715966384}
Example:
curl -X POST 'https://p2p.army/v1/api/time'

P2P

Fiat currencies

Getting a list of fiat currencies in P2P.

Request:
https://p2p.army/v1/api/get_p2p_fiats
Response:
{
    "rows": [
        "AED",
        "ALL",
        "AMD",
        "AOA",
        "ARS",
        "AUD",
        "AZN",
        "BAM",
        ...,
        "XOF",
        "YER",
        "ZAR",
        "ZMW"
    ],
    "status": 1
}
Example:
curl -X POST 'https://p2p.army/v1/api/get_p2p_fiats'

P2P crypto assets

Receiving crypto assets in P2P.

Request:
https://p2p.army/v1/api/get_p2p_assets
Example:
curl -X POST 'https://p2p.army/v1/api/get_p2p_assets' -d '{"market":"bybit","fiat":"INR"}'
Request Params:
Parameter Required Notice
market yes P2P exchange, for example: binance
fiat yes fiat currency, for example: EUR
Response:
{
    "assets": [
        "USDT",
        "BTC",
        "ETH",
        "USDC"
    ],
    "status": 1
}
Response Params:
Parameter Notice
assets list of crypto assets

P2P payment methods

Getting payment methods in P2P using input data: market+fiat.

Request:
https://p2p.army/v1/api/get_popular_p2p_payment_methods
Example:
curl -X POST 'https://p2p.army/v1/api/get_popular_p2p_payment_methods' -d '{"market":"bybit","fiat":"INR"}'
Request Params:
Parameter Required Notice
market yes P2P exchange, for example: binance
fiat yes fiat currency, for example: EUR
limit no output limit
Response:
{
    "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
}
Response Params:
Parameter Notice
ads_count_BUYNumber of ads in the BUY section.
ads_count_SELLNumber of ads in the SELL section.
ads_count_totalTotal ads.
marketP2P exchange, for example: binance
titleName of payment method.
payment_methodPayment method code.
activity_24hActivity for 24 hours.
payment_method_vendor_idID of the payment method on the platform. (only for some)

P2P prices

Getting prices on the P2P platform using input data: market+fiat+asset.

Request:
https://p2p.army/v1/api/get_p2p_prices
Example:
curl -X POST 'https://p2p.army/v1/api/get_p2p_prices' -d '{"market":"bybit","fiat":"RUB","asset":"USDT","limit":10}'
Request Params:
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
Response:
{
    "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
        },
        ...
    ]
}
Response Params:
Parameter Notice
payment_methodPayment method code.
payment_method_vendor_idID of the payment method on the platform. (only for some)
updated_BUYTimestamp, UTC. Time of price synchronization from the BUY section.
updated_SELLTimestamp, UTC. Time of price synchronization from the SELL section.
prices_BUYArray of TOP10 prices from the BUY section.
prices_SELLArray 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_24hActivity for 24 hours.
ads_count_BUYNumber of ads in the BUY section.
ads_count_SELLNumber of ads in the SELL section.
ads_count_totalTotal 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.

P2P ads

Receiving advertisements on the P2P platform using input data: market+fiat+asset+side.

The method returns ads in a single format from all exchanges.

Request:
https://p2p.army/v1/api/get_p2p_order_book
Example:
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}'
Request Params:
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
Response:
{
    "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
        },
        ...
         ]
}
Response Params:
Parameter Type/values Notice
posintAd position
updated_attimestamp, UTCtime of receipt of advertisement
marketstringexchange
assetstringcrypto asset
fiatstringfiat currency
sideBUY, SELL
payment_methodsarrayList of all specified payment methods
pricefloatPrice
surplus_amountfloatAmount of crypto asset in the ad
surplus_fiatfloatsurplus_amount * price. Announcement volume in fiat.
min_fiatfloatMin. transaction amount
max_fiatfloatMax. transaction amount
text(if any)Ad text. It is not available on all platforms.
user_namestringUser name on the P2P exchange.
user_idstring|bigint|user_nameUser ID on the P2P exchange. The formats are completely different.
adv_idstring|bigintAd ID on the P2P exchange. The formats are completely different.
user_ordersintNumber of all orders or number of orders for the last 30 days.
user_rateint, 0-100Order completion percentage
is_merchant0 || 1Merchant status.

Vendor Ads

Receiving original advertisements from P2P platforms using input data: market+fiat+asset+side.

Each platform serves ads in different formats.

Request:
https://p2p.army/v1/api/get_p2p_vendor_book
Example:
curl -X POST 'https://p2p.army/v1/api/get_p2p_vendor_book' -d '{"market":"bybit","fiat":"INR","asset":"USDT","side":"BUY","limit":10}'
Request Params:
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
Response:
{
    "status": 1,
    "vendor_ads": [
        {
            ...
        },
        {
            ...
        },
        {
            ...
        },
        ...
     ]
}
Response Params:

vendor_ads contains information from exchanges without filtering on our part. Each exchange has its own response format.

P2P exchange statistics

Obtaining statistics of P2P exchanges, which is available on the page https://p2p.army/en/p2p/markets.

Request:
https://p2p.army/v1/api/stat/p2p_markets
Example:
curl -X POST 'https://p2p.army/v1/api/stat/p2p_markets' -d '{"limit":10}'
Request Params:
Parameter Required Note
limit no output limit. Default is 10.
Response:
{
    "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
        },
        ...
    ]
}
Response Params:
Parameter Notice
idInternal ID of the exchange
nameExchange code
titleExchange name
placePlace in the ranking
activity_24hActivity 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_BUYNumber of ads in the BUY section.
ads_SELLNumber of ads in the SELL section.
ads_totalTotal ads.
volume_usd_BUYVolume in $ of ads in the BUY section.
The entire volume of advertisements with assets USDT, BTC, ETH is summed up.
volume_usd_SELLVolume 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_totalvolume_usd_BUY + volume_usd_SELL
count_fiatsNumber of fiat currencies represented.

P2P currency statistics

Obtaining statistics of P2P currencies, which is available on the page https://p2p.army/en/p2p/fiats.

Request:
https://p2p.army/v1/api/stat/p2p_fiats
Example:
curl -X POST 'https://p2p.army/v1/api/stat/p2p_fiats' -d '{"type":"ads_count"}'
Request Params:
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.
Response:
{
    "status": 1,
    "fiats": [
        {
            "fiat": "USD",
            "points": 6431,
            "by_markets": {
                "binance": "3773",
                "okx": "343",
                "bybit": "701",
                "huobi": "1232",
                "bitget": "207",
                "kucoin": "175",
                "mexc": 0
            }
        },
        ...
    ]
}
Response Params:
Parameter Notice
fiatFiat code
pointsSum of by_markets array values
by_marketsArray of values by P2P exchange
by_markets.binanceNumber of values. The value type is specified by the type parameter.

P2P price history

Getting P2P price history, which is available on the page https://p2p.army/en/p2p/fiats/CNY/charts/USDT.

Request:
https://p2p.army/v1/api/history/p2p_prices
Example:
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}'
Request Params:
Parameter Required Options Notice
marketyesP2P market. Example: binance
fiatyesFiat currency. Example: CNY
assetyesCrypto 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.
 
modeno24H, 7D, 1M, 3M, 6M, 1Y, ALL.If mode is not specified, then you need to specify from_date + to_date
 
from_datenoTimestamp UTC(if mode is not specified) Date from. Hourly details.
to_datenoTimestamp UTC (if mode is not specified) Date to. Hourly details.
 
period_typeno1H, 0-23Data 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.
Response:
{
    "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
        },
        ...
    ]
}
Response Params:
Parameter Notice
datedatetime, UTC (or timestamp if date_format was specified)
buyThe price of the specified crypto asset using the payment method from the BUY section.
buy_avgAverage purchase price TOP5.
sellThe price of the specified crypto asset using the payment method from the SELL section.
sell_avgAverage purchase price TOP5.

Need other data/methods?

If you need other data, please contact technical support. If technically possible, we will try to give you what you need.

🙄 Found an error?

Please write to technical support.
We will be very grateful to you!