제목에서 알 수 있듯이 저는 Firefox 네트워크 탐색기를 사용하여 API를 사용하고 있습니다. 몇 가지를 성공적으로 복제했지만 이것은 다른 결과를 제공합니다.
따라서 네트워크에서 쿼리는 GET입니다.https://www.binance.com/gateway-api/v1/Friendly/lending/project/customizedFixedProject/list?pageSize=3&pageIndex=1&status=ALL응답은 유효한 JSON입니다(적어도 Firefox와 Chrome 모두 이를 표시합니다).
{"code":"000000","message":"null","messageDetail":null,"data":[{"asset":"USDT","list":[{"projectId":"CUSDT7DAYS001","projectName":"USDT","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"224565","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDT","interestRate":"0.06310000","interestPerLot":"0.12090000","duration":"7","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"1"},{"projectId":"CUSDT14DAYSS001","projectName":"USDT","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"190167","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDT","interestRate":"0.06480000","interestPerLot":"0.24860000","duration":"14","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"1"},{"projectId":"CUSDT30DAYSS001","projectName":"USDT","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"676977","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDT","interestRate":"0.06660000","interestPerLot":"0.54720000","duration":"30","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"1"},{"projectId":"CUSDT90DAYSS001","projectName":"USDT","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"969489","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDT","interestRate":"0.07000000","interestPerLot":"1.72700000","duration":"90","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"1"}]},{"asset":"BUSD","list":[{"projectId":"CBUSD7DAYS001","projectName":"BUSD","lotsUpLimit":"500000","lotsLowLimit":"1","lotsPurchased":"30744","maxLotsPerUser":"100000","lotSize":"100.00000000","asset":"BUSD","interestRate":"0.06310000","interestPerLot":"0.12090000","duration":"7","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"2"},{"projectId":"CBUSD14DAYSS001","projectName":"BUSD","lotsUpLimit":"500000","lotsLowLimit":"1","lotsPurchased":"20988","maxLotsPerUser":"100000","lotSize":"100.00000000","asset":"BUSD","interestRate":"0.06480000","interestPerLot":"0.24860000","duration":"14","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"2"},{"projectId":"CBUSD30DAYSS001","projectName":"BUSD","lotsUpLimit":"500000","lotsLowLimit":"1","lotsPurchased":"151414","maxLotsPerUser":"100000","lotSize":"100.00000000","asset":"BUSD","interestRate":"0.06660000","interestPerLot":"0.54720000","duration":"30","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"2"},{"projectId":"CBUSD90DAYSS001","projectName":"BUSD","lotsUpLimit":"500000","lotsLowLimit":"1","lotsPurchased":"204698","maxLotsPerUser":"100000","lotSize":"100.00000000","asset":"BUSD","interestRate":"0.07000000","interestPerLot":"1.72700000","duration":"90","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"2"}]},{"asset":"USDC","list":[{"projectId":"USDC7DAYSS001","projectName":"USDC","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"26688","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDC","interestRate":"0.05310000","interestPerLot":"0.10180000","duration":"7","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"3"},{"projectId":"USDC14DAYSS001","projectName":"USDC","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"19296","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDC","interestRate":"0.05480000","interestPerLot":"0.21010000","duration":"14","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"3"},{"projectId":"USDC30DAYSS001","projectName":"USDC","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"20059","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDC","interestRate":"0.05660000","interestPerLot":"0.46520000","duration":"30","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"3"},{"projectId":"USDC90DAYSS001","projectName":"USDC","lotsUpLimit":"2000000","lotsLowLimit":"1","lotsPurchased":"94209","maxLotsPerUser":"500000","lotSize":"100.00000000","asset":"USDC","interestRate":"0.06000000","interestPerLot":"1.47940000","duration":"90","needKyc":false,"canAutoRenew":true,"withWhiteList":false,"withAreaLimitation":false,"status":"PURCHASING","displayPriority":"3"}]}],"total":3,"success":true}
그러나 컬을 사용하여 동일한 웹 사이트에 액세스하려고 하면 일반 네트워크 오류가 발생합니다.
curl https://www.binance.com/gateway-api/v1/friendly/lending/project/customizedFixedProject/list?pageSize=3&pageIndex=1&status=ALL
HTTP/1.1 404 Not Found
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Date: Tue, 09 Feb 2021 21:19:48 GMT
Server: Tengine
Vary: Accept-Encoding
ETag: W/"5ff3db87-197a"
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubdomains
Content-Encoding: gzip
X-Cache: Error from cloudfront
Via: 1.1 da12738b8eacc0d543b2915c5e4262dd.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: SYD1-C2
X-Amz-Cf-Id: xS7LR0Qvm4onqjXxgaA7IG6LPrYNk3VJ0hFV0wFvk2Vk7oPTrRk8jw==
해당 API를 로드하는 사이트는https://www.binance.com/en/earn#fixed-item
다음은 스크린샷입니다.
답변1
컬의 몇 가지 추가 기능을 사용하여 작동하게 만들었습니다.curl -XGET -H "Content-type: application/json" 'https://www.binance.com/gateway-api/v1/friendly/lending/project/customizedFixedProject/list?pageSize=3&pageIndex=1&status=ALL'