400: Bad Request
Use this page for all 400 BAD REQUEST errors.
A 400 means the request could not be parsed or validated as valid input.
What Usually Causes 400
- URL is constructed incorrectly (path vs query string mixups)
- For path/query parsing issues caused by bad URL construction, see 400: URL Anatomy (Path vs Query Parameters).
- Query parameters are malformed (
?/&/key=valueissues) - Parameter type or format is invalid (string where number/date is expected)
- Parameter value is unsupported or out of range
- Option symbol is not valid OCC format
dateparameter is used in a current-data request (historical-only usage)
Case 1: URL Construction Problems (Path vs Query)
Common examples:
- Putting query parameters in the path segment
- Missing
?before query parameters - Using wrong separators between parameters
Correct structure:
https://api.marketdata.app/<endpoint-path>/?key=value&key2=value2
If you need a step-by-step URL-building guide, use:
Case 2: Invalid Parameter Type/Format/Value
You can get 400 when a parameter cannot be parsed correctly or violates endpoint rules.
Examples:
- Sending text where a numeric value is expected
- Sending a malformed date
- Sending an unsupported enum/value for a parameter
- Sending a value outside allowed bounds
Fast check:
- Confirm parameter names exactly match the endpoint docs.
- Confirm each parameter value type/format is valid.
- Remove optional parameters and re-add one at a time.
Case 3: Invalid Option Symbol (OCC)
You may receive:
{
"s": "error",
"errmsg": "Invalid option symbol. Use valid OCC symbology for the option symbol."
}
Meaning: request shape is valid, but optionSymbol is malformed.
For detailed format rules, examples, and validation workflow, use:
Case 4: date Parameter Is Historical-Only
You may receive:
{
"s": "error",
"errmsg": "Invalid date. The date parameter is used for historical queries only."
}
Meaning:
- Request can be otherwise valid
datewas used in a current-data context
How to fix:
- For current data: omit
date - For historical data: provide a past trading date
# Current request (correct): no date parameter
GET https://api.marketdata.app/v1/options/quotes/OPTION_SYMBOL/
# Historical request (correct): includes date
GET https://api.marketdata.app/v1/options/quotes/OPTION_SYMBOL/?date=2025-01-15
400 vs Other Status Codes
400: request input/format is invalid401: authentication issue (token missing/invalid)402: plan/entitlement limit reached403: forbidden by policy (for example multiple IP addresses)404: request format is valid, but requested resource was not found
If You Still Get 400
- Log full request URL and all query parameters
- Compare request against endpoint docs field-by-field
- Re-test with only required parameters
- Add optional parameters back one at a time