Skip to Content

Retrieve the List of Securities

Retrieve the List of Securities

Request

HTTP MethodGET
HTTP URL/v1/quote/get_security_list

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
marketstringYESMarket, currently only supports US
categorystringYESMarket subcategory, only supports Overnight

Request Example

python
from longport.openapi import QuoteContext, Config, Market, SecurityListCategory

config = Config.from_env()
ctx = QuoteContext(config)
resp = ctx.security_list(Market.US, SecurityListCategory.Overnight)
print(resp)

Response

Response Headers

  • Content-Type: application/json

Response Example

json
{
  "code": 0,
  "data": {
    "list": [
      {
        "symbol": "BAC.US",
        "name_cn": "美国银行",
        "name_hk": "美國銀行",
        "name_en": "Bank of America"
      },
      {
        "symbol": "RDDT.US",
        "name_cn": "REDDIT INC",
        "name_hk": "REDDIT INC",
        "name_en": "REDDIT INC"
      },
      {
        "symbol": "GOOGL.US",
        "name_cn": "谷歌-A",
        "name_hk": "谷歌-A",
        "name_en": "Alphabet"
      }
    ]
  }
}

Response Status

StatusDescriptionSchema
200Successful returnsecurity_response
400Parameter errorNone

Schemas

security_response

NameTypeRequiredDescription
listobject[]falseList
∟ symbolintegertrueSecurity code
∟ name_cnstringtrueChinese name
∟ name_hkstringtrueTraditional Chinese name
∟ name_enstringtrueEnglish name

Error Code

Business Error CodeDescriptionTroubleshooting Suggestion
310010Invalid requestCheck the request parameters
310011Internal server errorPlease retry or contact technical support