{"id":7010,"date":"2025-08-28T22:11:56","date_gmt":"2025-08-29T03:11:56","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=7010"},"modified":"2026-06-29T10:51:47","modified_gmt":"2026-06-29T15:51:47","slug":"fetching-a-single-instrument","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-core-sdk\/working-with-instruments\/fetching-a-single-instrument\/","title":{"rendered":"Fetching a Single Instrument"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The GetInstrument() function provides overloaded forms that let you identify instruments using different sets of criteria. These are listed below along with code snippets showing their use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fetch by instrument id<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\nttsdk::Instrument::ResponseCode respCode;\nuint64_t id = 3899904826036563588;\nttsdk::InstrumentPtr instrument = ttsdk::GetInstrument(id, respCode);\nif (!instrument)\n{\n        std::cout &lt;&lt; \"Unable to find instrument with id = \u201c &lt;&lt; id &lt;&lt; std::endl;\n}\n\n <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fetch by market ID, product name, product type and instrument alias\u00a0<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\nttsdk::Instrument::ResponseCode respCode;\nttsdk::MarketId market = ttsdk::MarketId::CME;\nstd::string product = \u201cGE\u201d;\nttsdk::ProductType productType = ttsdk::ProductType::Future;\nstd::string alias = \"GE Sep28\";\nttsdk::InstrumentPtr instrument = ttsdk::GetInstrument(market, product.c_str(),\n        productType, alias.c_str(), respCode);\nif (!instrument)\n{\n        std::cout &lt;&lt; \"Unable to find instrument with alias = \u201c &lt;&lt; alias &lt;&lt; std::endl;\n}\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note: <\/strong>The instrument alias parameter must match the string displayed in TT and TT Desktop, where it is called the \u201c<strong>contract alias<\/strong>\u201d. The instrument alias parameter for Autospreader and Aggregator instruments must match the name with which it was created.<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"wp-block-paragraph\">The GetInstrument() function provides overloaded forms that let you identify instruments using different sets of criteria. These are listed below along with code snippets showing their use.<\/p>\n<h2 class=\"wp-block-heading\">Fetch by instrument id<\/h2>\n<h2 class=\"wp-block-heading\">Fetch by market ID, product name, product type and instrument alias\u00a0<\/h2>\n<p class=\"wp-block-paragraph\"><strong>Note: <\/strong>The instrument alias parameter must match the string displayed in TT and TT Desktop, where it is called the \u201c<strong>contract alias<\/strong>\u201d. The instrument alias parameter for Autospreader and Aggregator instruments must match the name with which it was created.<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-core-sdk","meta":{"_acf_changed":false,"footnotes":""},"docs-category":[446],"class_list":["post-7010","doc","type-doc","status-publish","hentry","docs-category-working-with-instruments"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":3,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7010\/revisions"}],"predecessor-version":[{"id":59641,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7010\/revisions\/59641"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=7010"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=7010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}