Market Data

Get current quote

Retrieves current quote for the specified symbol:

1 import pprint
2
3 from lime_trader import LimeClient
4
5 client = LimeClient.from_file(file_path="credentials.json")
6 quote = client.market.get_current_quote(symbol="AAPL")
7 pprint.pprint(quote)

Get current quotes list

Retrieves current quotes for all symbols specified on the request list:

1 import pprint
2
3 from lime_trader import LimeClient
4
5 client = LimeClient.from_file(file_path="credentials.json")
6 quotes = client.market.get_current_quotes(symbols=["AAPL", "AMZN"])
7 pprint.pprint(quotes)

Get quotes history

Returns candle structures aggregated by 5 minutes for the last 7 days:

 1 import datetime
 2 import pprint
 3
 4 from lime_trader import LimeClient
 5 from lime_trader.models.market import Period
 6
 7 client = LimeClient.from_file(file_path="credentials.json")
 8 quotes = client.market.get_quotes_history(symbol="AAPL", period=Period.MINUTE_5,
 9                                           from_date=datetime.datetime.now() - datetime.timedelta(days=7),
10                                           to_date=datetime.datetime.now())
11 pprint.pprint(quotes)

Get trading schedule

Returns trading session info depending on current date and time:

1 import pprint
2
3 from lime_trader import LimeClient
4
5 client = LimeClient.from_file(file_path="credentials.json")
6 schedule = client.market.get_trading_schedule()
7 pprint.pprint(schedule)

Lookup securities

Searches the securities reference by the specified criteria. The criteria can be a symbol, part of a symbol or part of a company name. Gets first 100 items.

1 import pprint
2
3 from lime_trader import LimeClient
4 from lime_trader.models.page import PageRequest
5
6 client = LimeClient.from_file(file_path="credentials.json")
7 result = client.market.lookup_securities(query="AA",
8                                          page=PageRequest(size=100))
9 pprint.pprint(result)

Get time and sales history page

Retrieves the time and sales history, first page of size 20, ordered by descending timestamp:

 1 import datetime
 2 import pprint
 3
 4 from lime_trader import LimeClient
 5 from lime_trader.models.page import PageRequest
 6
 7 client = LimeClient.from_file(file_path="credentials.json")
 8 result = client.market.time_and_sales(symbol="AAPL",
 9                                      from_date=datetime.datetime.now() - datetime.timedelta(days=7),
10                                      to_date=datetime.datetime.now(),
11                                      page=PageRequest(page=1, size=20)
12                                      )
13 pprint.pprint(result)

Iterate through all pages of time and sales history

Iterates pages of the time and sales history for the last 7 days, starting with page 1, size 20, ordered by descending timestamp:

 1 import datetime
 2 import pprint
 3
 4 from lime_trader import LimeClient
 5 from lime_trader.models.page import PageRequest
 6
 7 client = LimeClient.from_file(file_path="credentials.json")
 8
 9 for page in client.market.iterate_time_and_sales(symbol="AAPL",
10                                                  from_date=datetime.datetime.now() - datetime.timedelta(days=7),
11                                                  to_date=datetime.datetime.now(),
12                                                  start_page=PageRequest(page=1, size=20)
13                                                  ):
14     pprint.pprint(page)

Get option series

Returns an array of option series by the specified underlying security’s symbol. Contains at least one element which is the default series. Option Series is a specific set of calls or puts on the same underlying security, with the same strike price and expiration date. For the most part there is just one series name that matches the symbol but in some cases related to corporate actions on the underlying security additional series are issued.

1 import pprint
2
3 from lime_trader import LimeClient
4
5 client = LimeClient.from_file(file_path="credentials.json")
6 result = client.market.get_option_series(symbol="AAPL")
7 pprint.pprint(result)

Get option chain

Returns option contracts for specified symbol, expiration date and series.

1 import pprint
2
3 from lime_trader import LimeClient
4
5 client = LimeClient.from_file(file_path="credentials.json")
6 result = client.market.get_option_chain(symbol="AAPL", expiration=datetime.date(2026, 12, 18), series="AAPL")
7 pprint.pprint(result)