API Support Forum
OEC API > Market Data > ID function
Author Topic: ID function
(3 messages, Page 1 of 1)
Moderators: VPfau
FGiordano538
Posts: 24
Joined: May 09, 2022


Posted: Jun 23, 2022 @ 04:59 AM             Msg. 1 of 3
there is a function that returns the contracts.id through the symbol.
without going through the SymbolLookupEventArgs event?
SPikalov
Posts: 25
Joined:


Posted: Jul 13, 2022 @ 05:50 AM             Msg. 2 of 3
You can use:
var client = GFApi.CreateClient();
….
var contractID = client.Contracts.Get("ESZ22")?.ID;

But it can return null if the contract is not loaded from a server

For guaranteed results, you still need to use:
client.Contracts.Lookup.BySymbol("ESZ22");
and
“SymbolLookupEventArgs event”
FGiordano538
Posts: 24
Joined: May 09, 2022


Posted: Jul 15, 2022 @ 02:53 AM             Msg. 3 of 3
thank you