Lookup
Generate a properly formatted OCC option symbol based on the user's human-readable description of an option. This endpoint converts text such as "AAPL 7/28/23 $200 Call" to OCC option symbol format: AAPL230728C00200000. The user input must be URL-encoded.
Endpoint
https://api.marketdata.app/v1/options/lookup/{userInput}
Method
GET
Request Example
- HTTP
- NodeJS
- Python
- Go
fetch(
"https://api.marketdata.app/v1/options/lookup/AAPL%207/28/2023%20200%20Call"
)
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
import requests
url = "https://api.marketdata.app/v1/options/lookup/AAPL%207/28/2023%20200%20Call"
response = requests.request("GET", url)
print(response.text)
import (
"fmt"
api "github.com/MarketDataApp/sdk-go"
)
func ExampleOptionLookupRequest() {
optionSymbol, err := OptionLookup().UserInput("AAPL 7/28/2023 200 Call").Get()
if err != nil {
fmt.Print(err)
return
}
fmt.Println(optionSymbol)
}
Response Example
{
"s": "ok",
"optionSymbol": "AAPL230728C00200000"
}
Request Parameters
- Required
-
userInput
stringThe human-readable string input that contains (1) stock symbol (2) strike (3) expiration date (4) option side (i.e. put or call). This endpoint will translate the user's input into a valid OCC option symbol.
Response Attributes
- Success
- Error
-
s
stringStatus will always be
okwhen the OCC option symbol is successfully generated. -
optionSymbol
stringThe generated OCC option symbol based on the user's input.
-
s
stringStatus will be
errorif the request produces an error response. -
errmsg
stringAn error message.
Notes
- This endpoint will return an error if the option symbol that would be formed by the user's input does not exist.
Usage Information
Data Availability
This endpoint provides option symbol lookup functionality. This endpoint does not require any exchange entitlements and is available to all users.
| User Type | Exchange Entitlement | Data Type |
|---|---|---|
| All Users | Not Required | Utility Data |
Pricing
The cost of using the lookup API endpoint is 1 credit per API call.
| Data Type | Cost Basis | Credits Required per Unit |
|---|---|---|
| Lookup Data | Per API call | 1 credit |