tastytradeDeveloper Docs
Legacy ↗

API Reference / Market Sessions

Get Current Sessions By Collection

getMarketTimeSessionsCurrent
get/market-time/sessions/current

Base URL: https://api.cert.tastyworks.com (Sandbox) · https://api.tastyworks.com (Production)

Returns the current trading session, plus its previous and next sessions, for an instrument collection supplied via the required `instrument-collections[]` query parameter (`CFE`, `CME`, or `Equity`). Use this to check the current market state.

Code samples

curl -X GET 'https://api.cert.tastyworks.com/market-time/sessions/current?instrument-collections[]=CFE' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'User-Agent: tastytrade-docs-example/1.0'

Parameters

NameInTypeDescription
instrument-collections*queryarrayList of instrument collections . i.e. `CFE`, `CME` or `Equity` (example: instrument-collections[]={value1}&instrument-collections[]={value2})
e.g. ["CFE"]

Responses

200The current session with its surrounding previous and next sessions.application/json

Example response

{
  "data": {
    "close-at": "2024-01-15T14:30:00.000Z",
    "close-at-ext": "2024-01-15T14:30:00.000Z",
    "instrument-collection": "Equity",
    "open-at": "2024-01-15T14:30:00.000Z",
    "start-at": "2024-01-15T14:30:00.000Z",
    "next-session": {
      "close-at": "2024-01-15T14:30:00.000Z",
      "close-at-ext": "2024-01-15T14:30:00.000Z",
      "instrument-collection": "string",
      "open-at": "2024-01-15T14:30:00.000Z",
      "session-date": "2024-01-15",
      "start-at": "2024-01-15T14:30:00.000Z"
    },
    "previous-session": {
      "close-at": "2024-01-15T14:30:00.000Z",
      "close-at-ext": "2024-01-15T14:30:00.000Z",
      "instrument-collection": "string",
      "open-at": "2024-01-15T14:30:00.000Z",
      "session-date": "2024-01-15",
      "start-at": "2024-01-15T14:30:00.000Z"
    },
    "state": "string"
  },
  "context": "/market-time/sessions/current"
}

Schema

  • datarequiredobject (CurrentSessionDeserializer)

    The current trading session for an instrument collection, including its state and the immediately previous and next sessions.

    • close-atstring <date-time>

      ISO-8601 date-time at which the session closes.

    • close-at-extstring <date-time>

      ISO-8601 date-time of the session's extended close.

    • instrument-collectionstring

      The instrument collection this session applies to, for example `Equity`, `CME`, or `CFE`.

      example: "Equity"

    • open-atstring <date-time>

      ISO-8601 date-time at which the session opens.

    • start-atstring <date-time>

      ISO-8601 date-time at which the session starts.

    • next-sessionobject{6 fields}

      The next trading session that follows the current one.

    • previous-sessionobject{6 fields}

      The previous trading session that preceded the current one.

    • statestring

      The current state of the market for this session.

  • contextrequiredstring

    example: "/market-time/sessions/current"

401Missing or expired access token, or a missing/malformed `User-Agent` header.application/json

Example response

{
  "error": {
    "code": "unauthorized",
    "message": "No valid access token was provided; access tokens expire after 15 minutes."
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

422Invalid or missing `instrument-collections[]` values. Allowed values are `CFE`, `CME`, and `Equity`.application/json

Example response

{
  "error": {
    "code": "preflight_check_failure",
    "message": "One or more preflight checks failed",
    "errors": [
      {
        "code": "preflight_check_failure",
        "message": "A specific validation failed for this order."
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

429Too many requests. Back off and reduce your request rate.application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

Related

Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.