binance / binance-api-swagger Goto Github PK
View Code? Open in Web Editor NEWSwagger for the Binance Public API
Swagger for the Binance Public API
None of the properties in schemas
are marked as required, so technically they are all optional. While this is probably not an issue for human readers, it prevents code generators(e.g. typescript definitions generators) from accurately interpreting the spec, assuming that the properties are not actually optional.
因为在yaml文件中,大部分time字段的类型设置为integer和number类型,visual stdio 2019 会把integer转换成int32类型,导致无法存储时间导致转换异常,number类型会默认转换成double类型。
Hello, no offence, but is this repo actively maintained? It looks outdated (last commit from 29 Aug) compared to https://binance-docs.github.io/apidocs/spot/en/#change-log. I am depending on this swagger api data in my code.
Before submitting a new issue, please check if a similar issue has already been filed.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Before submitting a new issue, please check if a similar issue has already been filed.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
the documentation states:
https://binance-docs.github.io/apidocs/spot/en/#limits
IP Limits
Every request will contain X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter) in the response headers which has the current used weight for the IP for all request rate limiters defined.
Each route has a weight which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier weight.
When a 429 is received, it's your obligation as an API to back off and not spam the API.
Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).
IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
A Retry-After header is sent with a 418 or 429 responses and will give the number of seconds required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over.
The limits on the API are based on the IPs, not the API keys.
but when generating the code these headers are missing since not in the spec
Currently, swagger-codegen doesn't support oneOf and anyOf tags, sot it needed to be manually fixed each time.
Also, it's just stupid to make things this way. For example:
Endpoint /sapi/v1/accountSnapshot has parameter "type" which is enum with values [SPOT, MARGIN, FUTURES] and depending on its value endpoint returns one of [snapshotSpot, snapshotMargin, snapshotFutures]. Which is.. just madness if you use strong-typed language (using weak/dynamic typed language to trade crypto is madness itself).
Why don't simple use 3 endpoints with 3 different returning types instead?
/sapi/v1/accountSnapshotSpot -> snapshotSpot
/sapi/v1/accountSnapshotMargin -> snapshotMargin
/sapi/v1/accountSnapshotFutures -> snapshotFutures
No hope you will fix first 2 points, but this one is pretty simple. Please, move inlined responses to the components section. Currently this structures has no names, so swagger-codegen naming it like InlineResponse2005, InlineResponse20054, etc. But when you use a language with types, it is very nice to have not just a variable with some sort of data, but also its type which may be a hint by itself in some cases.
The [offset] input parameter to the endpoint [/sapi/v1/capital/deposit/hisrec] / “Fetch deposit history.” is not documented and has no description anywhere - kindly please document it or at least add a simple description.
Originally posted by @Bigboy1982 in data-8/data8assets#9
is this being slated as TODO on your side?
alternatively, is it available anywhere else?
as a side note, this can be partially already done from the Postman definitions in the other repo using this pipeline:
For example for /dapi:
curl https://raw.githubusercontent.com/binance/binance-api-postman/master/collections/Binance%20Coin-M%20Futures%20API.postman_collection.json | postman2openapi | openapi-typescript
the drawbacks here is that the conversion from postman to openapi is lossy as the type info as well as which parameters are optional are lost. Instead everything becomes string
, but at least the field names and paths are preserved as well as the comments
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.