> For the complete documentation index, see [llms.txt](https://developer.barchart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.barchart.com/architecture/openfeed-api-proto.md).

# api.proto

## BulkSubscriptionFilter

Bulk subscription filter.

| Field         | Type                      | Label | Description                                                        |
| ------------- | ------------------------- | ----- | ------------------------------------------------------------------ |
| symbolType    | [SymbolType](#SymbolType) |       | Type of the symbol: Barchart or Exchange. Barchart is the default. |
| symbolPattern | [string](#string)         |       | regular expression pattern for the symbol                          |

## ExchangeRequest

Exchange Request, returns ExchangeResponse. Gives available exchanges.

| Field         | Type              | Label | Description |
| ------------- | ----------------- | ----- | ----------- |
| correlationId | [sint64](#sint64) |       |             |
| token         | [string](#string) |       |             |

## ExchangeResponse

| Field         | Type                                                   | Label    | Description |
| ------------- | ------------------------------------------------------ | -------- | ----------- |
| correlationId | [sint64](#sint64)                                      |          |             |
| status        | [Status](#Status)                                      |          |             |
| exchanges     | [ExchangeResponse.Exchange](#ExchangeResponseExchange) | repeated |             |

## ExchangeResponse.Exchange

| Field       | Type              | Label    | Description |
| ----------- | ----------------- | -------- | ----------- |
| code        | [string](#string) |          |             |
| description | [string](#string) |          |             |
| aliases     | [string](#string) | repeated |             |
| exchangeId  | [sint32](#sint32) |          |             |

## InstrumentReferenceRequest

Instrument References, returns InstrumentReferenceResponse(s)

| Field         | Type              | Label | Description |
| ------------- | ----------------- | ----- | ----------- |
| correlationId | [sint64](#sint64) |       |             |
| token         | [string](#string) |       |             |
| symbol        | [string](#string) |       |             |
| marketId      | [sint64](#sint64) |       |             |
| exchange      | [string](#string) |       |             |
| channelId     | [sint32](#sint32) |       |             |

## InstrumentReferenceResponse

| Field               | Type              | Label | Description |
| ------------------- | ----------------- | ----- | ----------- |
| correlationId       | [sint64](#sint64) |       |             |
| status              | [Status](#Status) |       |             |
| numberOfDefinitions | [sint32](#sint32) |       |             |
| channelId           | [sint32](#sint32) |       |             |
| marketId            | [sint64](#sint64) |       |             |
| symbol              | [string](#string) |       |             |
| exchange            | [string](#string) |       |             |
| ddfSymbol           | [string](#string) |       |             |
| ddfExchange         | [string](#string) |       |             |
| ddfBaseCode         | [string](#string) |       |             |
| exchangeSymbol      | [string](#string) |       |             |
| exchangeId          | [sint32](#sint32) |       |             |

## InstrumentRequest

Instrument Definition(s), will stream InstrumentDefinition(s)

| Field          | Type                                                                       | Label    | Description                                                                   |
| -------------- | -------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------- |
| correlationId  | [sint64](#sint64)                                                          |          |                                                                               |
| token          | [string](#string)                                                          |          |                                                                               |
| instrumentType | [InstrumentDefinition.InstrumentType](#InstrumentDefinitionInstrumentType) | repeated | Filter on these instrument types                                              |
| spreadType     | [string](#string)                                                          | repeated | Filter on these spread types                                                  |
| version        | [sint32](#sint32)                                                          |          | If version >= 1 then will send InstrumentDefinition in the InstrumentResponse |
| symbol         | [string](#string)                                                          |          |                                                                               |
| marketId       | [sint64](#sint64)                                                          |          |                                                                               |
| exchange       | [string](#string)                                                          |          |                                                                               |
| channelId      | [sint32](#sint32)                                                          |          |                                                                               |

## InstrumentResponse

| Field                | Type                                          | Label | Description                                   |
| -------------------- | --------------------------------------------- | ----- | --------------------------------------------- |
| correlationId        | [sint64](#sint64)                             |       |                                               |
| status               | [Status](#Status)                             |       |                                               |
| numberOfDefinitions  | [sint32](#sint32)                             |       |                                               |
| symbol               | [string](#string)                             |       |                                               |
| marketId             | [sint64](#sint64)                             |       |                                               |
| exchange             | [string](#string)                             |       |                                               |
| channelId            | [sint32](#sint32)                             |       |                                               |
| exchangeId           | [sint32](#sint32)                             |       |                                               |
| instrumentDefinition | [InstrumentDefinition](#InstrumentDefinition) |       | Will be set if InstrumentRequest.version >= 1 |

## ListSubscriptionsRequest

List Subscriptions for a user

| Field         | Type              | Label | Description |
| ------------- | ----------------- | ----- | ----------- |
| correlationId | [sint64](#sint64) |       |             |
| token         | [string](#string) |       |             |
| username      | [string](#string) |       |             |

## ListSubscriptionsResponse

| Field         | Type                                                                   | Label    | Description |
| ------------- | ---------------------------------------------------------------------- | -------- | ----------- |
| correlationId | [sint64](#sint64)                                                      |          |             |
| status        | [Status](#Status)                                                      |          |             |
| username      | [string](#string)                                                      |          |             |
| sessions      | [ListSubscriptionsResponse.Session](#ListSubscriptionsResponseSession) | repeated |             |

## ListSubscriptionsResponse.Session

| Field                 | Type                                                                             | Label    | Description            |
| --------------------- | -------------------------------------------------------------------------------- | -------- | ---------------------- |
| loginTime             | [sint64](#sint64)                                                                |          | Nano second unix epoch |
| token                 | [string](#string)                                                                |          |                        |
| clientVersion         | [string](#string)                                                                |          |                        |
| marketSubscriptions   | [ListSubscriptionsResponse.Subscription](#ListSubscriptionsResponseSubscription) | repeated |                        |
| exchangeSubscriptions | [ListSubscriptionsResponse.Subscription](#ListSubscriptionsResponseSubscription) | repeated |                        |

## ListSubscriptionsResponse.Subscription

| Field          | Type                                                                           | Label    | Description |
| -------------- | ------------------------------------------------------------------------------ | -------- | ----------- |
| subscriptionId | [string](#string)                                                              |          |             |
| symbolId       | [string](#string)                                                              |          |             |
| marketId       | [sint64](#sint64)                                                              |          |             |
| symbolCounts   | [ListSubscriptionsResponse.SymbolCount](#ListSubscriptionsResponseSymbolCount) | repeated |             |
| exchange       | [string](#string)                                                              |          |             |
| root           | [string](#string)                                                              |          |             |

## ListSubscriptionsResponse.SymbolCount

| Field  | Type              | Label | Description |
| ------ | ----------------- | ----- | ----------- |
| symbol | [string](#string) |       |             |
| count  | [sint32](#sint32) |       |             |

## LoginRequest

Login

| Field           | Type              | Label | Description    |
| --------------- | ----------------- | ----- | -------------- |
| correlationId   | [sint64](#sint64) |       |                |
| username        | [string](#string) |       |                |
| password        | [string](#string) |       |                |
| clientVersion   | [string](#string) |       |                |
| protocolVersion | [sint32](#sint32) |       |                |
| jwt             | [string](#string) |       | JSON Web Token |

## LoginResponse

| Field         | Type              | Label | Description |
| ------------- | ----------------- | ----- | ----------- |
| correlationId | [sint64](#sint64) |       |             |
| status        | [Status](#Status) |       |             |
| token         | [string](#string) |       |             |

## LogoutRequest

Logout

| Field         | Type              | Label | Description |
| ------------- | ----------------- | ----- | ----------- |
| correlationId | [sint64](#sint64) |       |             |
| token         | [string](#string) |       |             |

## LogoutResponse

| Field         | Type              | Label | Description |
| ------------- | ----------------- | ----- | ----------- |
| correlationId | [sint64](#sint64) |       |             |
| status        | [Status](#Status) |       |             |

## OpenfeedGatewayMessage

Openfeed Server Response

| Field                       | Type                                                        | Label | Description |
| --------------------------- | ----------------------------------------------------------- | ----- | ----------- |
| loginResponse               | [LoginResponse](#LoginResponse)                             |       |             |
| logoutResponse              | [LogoutResponse](#LogoutResponse)                           |       |             |
| instrumentResponse          | [InstrumentResponse](#InstrumentResponse)                   |       |             |
| instrumentReferenceResponse | [InstrumentReferenceResponse](#InstrumentReferenceResponse) |       |             |
| subscriptionResponse        | [SubscriptionResponse](#SubscriptionResponse)               |       |             |
| marketStatus                | [MarketStatus](#MarketStatus)                               |       |             |
| heartBeat                   | [HeartBeat](#HeartBeat)                                     |       |             |
| instrumentDefinition        | [InstrumentDefinition](#InstrumentDefinition)               |       |             |
| marketSnapshot              | [MarketSnapshot](#MarketSnapshot)                           |       |             |
| marketUpdate                | [MarketUpdate](#MarketUpdate)                               |       |             |
| volumeAtPrice               | [VolumeAtPrice](#VolumeAtPrice)                             |       |             |
| ohlc                        | [Ohlc](#Ohlc)                                               |       |             |
| exchangeResponse            | [ExchangeResponse](#ExchangeResponse)                       |       |             |
| instrumentAction            | [InstrumentAction](#InstrumentAction)                       |       |             |
| listSubscriptionsResponse   | [ListSubscriptionsResponse](#ListSubscriptionsResponse)     |       |             |

## OpenfeedGatewayRequest

Openfeed Server request

| Field                      | Type                                                      | Label | Description |
| -------------------------- | --------------------------------------------------------- | ----- | ----------- |
| loginRequest               | [LoginRequest](#LoginRequest)                             |       |             |
| logoutRequest              | [LogoutRequest](#LogoutRequest)                           |       |             |
| subscriptionRequest        | [SubscriptionRequest](#SubscriptionRequest)               |       |             |
| instrumentRequest          | [InstrumentRequest](#InstrumentRequest)                   |       |             |
| instrumentReferenceRequest | [InstrumentReferenceRequest](#InstrumentReferenceRequest) |       |             |
| exchangeRequest            | [ExchangeRequest](#ExchangeRequest)                       |       |             |
| listSubscriptionsRequest   | [ListSubscriptionsRequest](#ListSubscriptionsRequest)     |       |             |

## Status

Serivce Messages /////////////////

| Field   | Type                | Label | Description |
| ------- | ------------------- | ----- | ----------- |
| result  | [Result](#Result)   |       |             |
| message | [string](#string)   |       |             |
| service | [Service](#Service) |       |             |

## SubscriptionRequest

Subscription Request

| Field         | Type                                                       | Label    | Description                                                         |
| ------------- | ---------------------------------------------------------- | -------- | ------------------------------------------------------------------- |
| correlationId | [sint64](#sint64)                                          |          | Client-assigned id for this request. Response will include same id  |
| token         | [string](#string)                                          |          |                                                                     |
| service       | [Service](#Service)                                        |          | Preferred service (realtime or delayed). REAL\_TIME is the default. |
| unsubscribe   | [bool](#bool)                                              |          |                                                                     |
| requests      | [SubscriptionRequest.Request](#SubscriptionRequestRequest) | repeated |                                                                     |

## SubscriptionRequest.Request

| Field                            | Type                                                                       | Label    | Description                                                        |
| -------------------------------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------ |
| symbol                           | [string](#string)                                                          |          |                                                                    |
| marketId                         | [sint64](#sint64)                                                          |          |                                                                    |
| exchange                         | [string](#string)                                                          |          |                                                                    |
| channelId                        | [sint32](#sint32)                                                          |          |                                                                    |
| subscriptionType                 | [SubscriptionType](#SubscriptionType)                                      | repeated |                                                                    |
| snapshotIntervalSeconds          | [sint32](#sint32)                                                          |          | 0 = send only current snapshot once, else send at interval seconds |
| instrumentType                   | [InstrumentDefinition.InstrumentType](#InstrumentDefinitionInstrumentType) | repeated | Spreads and Options must be explicitly requested.                  |
| bulkSubscriptionFilter           | [BulkSubscriptionFilter](#BulkSubscriptionFilter)                          | repeated | Filter for the exchange and channel subscriptions.                 |
| spreadTypeFilter                 | [string](#string)                                                          | repeated | Filter for Spread Types                                            |
| subscriptionDoNotSendInstruments | [bool](#bool)                                                              |          | Do not send instrument(s) on successful subscription               |
| subscriptionDoNotSendSnapshots   | [bool](#bool)                                                              |          | Do not send market snapshot(s) on successful subscription          |

## SubscriptionResponse

| Field                   | Type                                  | Label | Description |
| ----------------------- | ------------------------------------- | ----- | ----------- |
| correlationId           | [sint64](#sint64)                     |       |             |
| status                  | [Status](#Status)                     |       |             |
| symbol                  | [string](#string)                     |       |             |
| marketId                | [sint64](#sint64)                     |       |             |
| exchange                | [string](#string)                     |       |             |
| channelId               | [sint32](#sint32)                     |       |             |
| numberOfDefinitions     | [sint32](#sint32)                     |       |             |
| subscriptionType        | [SubscriptionType](#SubscriptionType) |       |             |
| unsubscribe             | [bool](#bool)                         |       |             |
| snapshotIntervalSeconds | [sint32](#sint32)                     |       |             |

## Result

| Name                     | Number | Description |
| ------------------------ | ------ | ----------- |
| UNKNOWN\_RESULT          | 0      |             |
| SUCCESS                  | 1      |             |
| INSTRUMENTS\_NOT\_FOUND  | 112    |             |
| JWT\_EXPIRED             | 113    |             |
| JWT\_INVALID             | 114    |             |
| DUPLICATE\_LOGIN         | 115    |             |
| INVALID\_SYMBOL          | 116    |             |
| INVALID\_MARKET\_ID      | 117    |             |
| INVALID\_EXCHANGE        | 118    |             |
| INVALID\_CHANNEL\_ID     | 119    |             |
| MALFORMED\_MESSAGE       | 120    |             |
| UNEXPECTED\_MESSAGE      | 121    |             |
| NOT\_SUBSCRIBED          | 122    |             |
| DUPLICATE\_SUBSCRIPTION  | 123    |             |
| INVALID\_CREDENTIALS     | 124    |             |
| INSUFFICIENT\_PRIVILEGES | 125    |             |
| AUTHENTICATION\_REQUIRED | 126    |             |
| GENERIC\_FAILURE         | 127    |             |
| INVALID\_USERNAME        | 128    |             |

## SubscriptionType

| Name               | Number | Description |
| ------------------ | ------ | ----------- |
| ALL                | 0      |             |
| QUOTE              | 1      |             |
| QUOTE\_PARTICIPANT | 2      |             |
| DEPTH\_PRICE       | 3      |             |
| DEPTH\_ORDER       | 4      |             |
| TRADES             | 5      |             |
| CUMULATIVE\_VOLUME | 6      |             |
| OHLC               | 7      |             |
| OHLC\_NON\_REGULAR | 8      |             |
| SETTLEMENT         | 9      |             |

## SymbolType

Symbol type for the subscription filter.

| Name     | Number | Description |
| -------- | ------ | ----------- |
| BARCHART | 0      |             |
| EXCHANGE | 1      |             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.barchart.com/architecture/openfeed-api-proto.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
