> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://okx-demo.ferndocs.com/api/api-reference/public-data/get-instruments/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://okx-demo.ferndocs.com/_mcp/server. # Get instruments GET https://www.okx.com/api/v5/public/instruments Retrieve a list of instruments with open contracts for the given instrument type. Reference: https://okx-demo.ferndocs.com/api/api-reference/public-data/get-instruments ## Request ### Query parameters - `instType` (enum, required) — Instrument type. - Allowed values: `SPOT`, `MARGIN`, `SWAP`, `FUTURES`, `OPTION`, `EVENTS` - `uly` (string, optional) — Underlying, e.g. BTC-USD. Only applicable to FUTURES/SWAP/OPTION. - `instFamily` (string, optional) — Instrument family, e.g. BTC-USD. Only applicable to FUTURES/SWAP/OPTION. - `instId` (string, optional) — Instrument ID, e.g. BTC-USD-SWAP. ## Response ### 200 Successful response - `code` (string, optional) — Result code. `0` means success; any other value is an error code. - `msg` (string, optional) — Error message. Empty on success. - `data` (list of ApiV5PublicInstrumentsGetResponsesContentApplicationJsonSchemaDataItems, optional) ## Types ### ApiV5PublicInstrumentsGetResponsesContentApplicationJsonSchemaDataItems - `instType` (string, optional) — Instrument type. - `instId` (string, optional) — Instrument ID, e.g. BTC-USD-SWAP. - `uly` (string, optional) — Underlying, e.g. BTC-USD. Only applicable to FUTURES/SWAP/OPTION. - `instFamily` (string, optional) — Instrument family, e.g. BTC-USD. Only applicable to FUTURES/SWAP/OPTION. - `category` (string, optional) — Currency category. Note: this parameter is deprecated. - `baseCcy` (string, optional) — Base currency, e.g. BTC in BTC-USDT. Only applicable to SPOT/MARGIN. - `quoteCcy` (string, optional) — Quote currency, e.g. USDT in BTC-USDT. Only applicable to SPOT/MARGIN. - `settleCcy` (string, optional) — Settlement and margin currency, e.g. BTC. Only applicable to FUTURES/SWAP/OPTION. - `ctVal` (string, optional) — Contract value. Only applicable to FUTURES/SWAP/OPTION. - `ctMult` (string, optional) — Contract multiplier. Only applicable to FUTURES/SWAP/OPTION. - `ctValCcy` (string, optional) — Contract value currency. Only applicable to FUTURES/SWAP/OPTION. - `optType` (string, optional) — Option type, C or P. Only applicable to OPTION. - `stk` (string, optional) — Strike price. Only applicable to OPTION. - `listTime` (string, optional) — Listing time, Unix timestamp in milliseconds. - `expTime` (string, optional) — Expiry time, Unix timestamp in milliseconds. Applicable to FUTURES/OPTION. - `lever` (string, optional) — Maximum leverage. Not applicable to SPOT/OPTION. - `tickSz` (string, optional) — Tick size, e.g. 0.0001. - `lotSz` (string, optional) — Lot size, i.e. the minimum increment of order size. - `minSz` (string, optional) — Minimum order size. - `ctType` (string, optional) — Contract type: linear or inverse. Only applicable to FUTURES/SWAP. - `alias` (string, optional) — Alias, e.g. this_week, next_week, this_month. Only applicable to FUTURES. - `state` (string, optional) — Instrument status: live, suspend, preopen, test, expired, settling. - `maxLmtSz` (string, optional) — Maximum order quantity of a single limit order. - `maxMktSz` (string, optional) — Maximum order quantity of a single market order. - `maxTwapSz` (string, optional) — Maximum order quantity of a single TWAP order. - `maxIcebergSz` (string, optional) — Maximum order quantity of a single iceberg order. - `maxTriggerSz` (string, optional) — Maximum order quantity of a single trigger order. - `maxStopSz` (string, optional) — Maximum order quantity of a single stop market order. ## Examples **Response** ```json { "code": "0", "msg": "", "data": [ { "instType": "SPOT", "instId": "BTC-USDT", "uly": "", "instFamily": "", "category": "1", "baseCcy": "BTC", "quoteCcy": "USDT", "settleCcy": "", "ctVal": "", "ctMult": "", "ctValCcy": "", "optType": "", "stk": "", "listTime": "1606468572000", "expTime": "", "lever": "10", "tickSz": "0.1", "lotSz": "0.00000001", "minSz": "0.00001", "ctType": "", "alias": "", "state": "live", "maxLmtSz": "9999999999", "maxMktSz": "", "maxTwapSz": "9999999999.0000000000000000", "maxIcebergSz": "9999999999.0000000000000000", "maxTriggerSz": "9999999999.0000000000000000", "maxStopSz": "", "auctionEndTime": "", "contTdSwTime": "1704876947000", "floatPxLmtPct": "0.03", "futureSettlement": false, "groupId": "1", "initPxLmtPct": "0.05", "instCategory": "1", "instIdCode": 1000000000, "maxLmtAmt": "1000000", "maxMktAmt": "1000000", "maxPxLmtPct": "0.15", "openType": "call_auction", "preMktSwTime": "", "ruleType": "normal", "tradeQuoteCcyList": [ "USDT" ], "upcChg": [ { "effTime": "1704876947000", "newValue": "0.0001", "param": "tickSz" } ] } ] } ``` **SDK Code** ```python publicData_getInstruments_example import requests url = "https://www.okx.com/api/v5/public/instruments" querystring = {"instType":"SPOT"} response = requests.get(url, params=querystring) print(response.json()) ``` ```javascript publicData_getInstruments_example const url = 'https://www.okx.com/api/v5/public/instruments?instType=SPOT'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go publicData_getInstruments_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://www.okx.com/api/v5/public/instruments?instType=SPOT" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby publicData_getInstruments_example require 'uri' require 'net/http' url = URI("https://www.okx.com/api/v5/public/instruments?instType=SPOT") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java publicData_getInstruments_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://www.okx.com/api/v5/public/instruments?instType=SPOT") .asString(); ``` ```php publicData_getInstruments_example request('GET', 'https://www.okx.com/api/v5/public/instruments?instType=SPOT'); echo $response->getBody(); ``` ```csharp publicData_getInstruments_example using RestSharp; var client = new RestClient("https://www.okx.com/api/v5/public/instruments?instType=SPOT"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift publicData_getInstruments_example import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://www.okx.com/api/v5/public/instruments?instType=SPOT")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```