RedoxNet.LsOpenApi.Core 1.2.0

dotnet add package RedoxNet.LsOpenApi.Core --version 1.2.0
                    
NuGet\Install-Package RedoxNet.LsOpenApi.Core -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RedoxNet.LsOpenApi.Core" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RedoxNet.LsOpenApi.Core" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="RedoxNet.LsOpenApi.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RedoxNet.LsOpenApi.Core --version 1.2.0
                    
#r "nuget: RedoxNet.LsOpenApi.Core, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RedoxNet.LsOpenApi.Core@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RedoxNet.LsOpenApi.Core&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=RedoxNet.LsOpenApi.Core&version=1.2.0
                    
Install as a Cake Tool

RedoxNet.LsOpenApi.Core

.NET SDK for the LS증권 OpenAPI (REST). Provides the auth, HTTP, TR catalog, and indicator primitives used by the RedoxNet.Mcp.LsOpenApi MCP server, and usable on its own as a Korean stock market data SDK.

Unofficial third-party SDK. Not affiliated with or endorsed by LS Securities Co., Ltd. (LS증권). Read-only market-data scope.

Install

dotnet add package RedoxNet.LsOpenApi.Core

Quick start

Wire the services into the DI container, then resolve LsApiClient and call any TR:

using Microsoft.Extensions.DependencyInjection;
using RedoxNet.LsOpenApi.Core;
using RedoxNet.LsOpenApi.Core.Http;
using System.Text.Json.Nodes;

var services = new ServiceCollection();
services
    .AddLogging()
    .AddLsOpenApiCore()
    .ConfigureLsOptionsFromEnvironment();   // reads LS_APPKEY / LS_APPSECRETKEY / LS_MARKET

var provider = services.BuildServiceProvider();
var client = provider.GetRequiredService<LsApiClient>();

// Call any TR (here: t1101 — 주식 현재가 호가조회 for Samsung Electronics).
var response = await client.CallTrAsync(
    "t1101",
    new JsonObject { ["shcode"] = "005930" });

if (response.IsSuccess)
{
    var quote = response.GetBlock("t1101OutBlock");
    // ... read fields from quote ...
}

What's in the box

Layer What it provides
Auth LsTokenIssuer — OAuth2 client_credentials, with LsTokenCache (SQLite WAL, key = SHA256(appkey):market — raw app key never on disk). Auto-refresh 5 min pre-expiry; concurrent issuance is serialized.
HTTP LsApiClient.CallTrAsync with Polly retries on 408/429/5xx + per-TR rate limiter + dual continuation modes (header tr_cont_key and body field continuation).
Catalog TrCatalog.Default — 53-TR catalog as an embedded resource (시세 / 차트 / 지수 / 업종 / 테마 / ETF / 스크리너 / 종목조회 / 기타). Search ranks by exact-code, name, category, description, and field-level matches.
Indicators IndicatorService over Skender.Stock.Indicators (SMA, EMA, RSI, MACD, Bollinger). Compact spec parser (ma:5, bb:20,2, macd:12,26,9).
Chart context ChartContextBuilder — pre-computed analysis block (divergence from each MA, volume averages, drawdown from period high, MA trend, tristate bullish_alignment with null during MA warm-up).
Analytical summary AnalyticalSummaryBuilder — token-efficient model-facing snapshot (period-aware MA snapshots, MA60 deviation + slope via least-squares fit, drawdown from peak, 1Y/5Y change, ZigZag-based key_turns with strict peak/trough alternation, and an IndicatorCoverage block that reports each indicator as ok / insufficient_data / disabled with a human-readable note when a window is too narrow).
ZigZag Threshold-reversal swing detector (ZigZag.Compute) with Percent or AtrMultiple modes. Triggers on the close (no intrabar self-trigger), strictly alternating peak/trough pivots, and a trailing tentative pivot at the latest bar for the in-progress swing.
Hygiene SecretMasker.Mask("...XYZW") → "****XYZW". App secret never logged. POSIX chmod 0600 on the token cache file + WAL/SHM siblings.

Credentials

LS_APPKEY and LS_APPSECRETKEY are read from the process environment via ConfigureLsOptionsFromEnvironment(). By design there is no other input path: MCP elicitation is explicitly avoided for static secrets, since prompting through chat would either log them or train callers to share them in transcripts.

Documentation & source

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 35 5/22/2026
1.1.0 35 5/22/2026
1.0.0 36 5/21/2026
0.10.1 35 5/20/2026
0.10.0 35 5/20/2026
0.9.0 39 5/20/2026
0.8.0 41 5/20/2026
0.7.0 92 5/18/2026
0.6.0 91 5/16/2026
0.5.0 88 5/15/2026
0.4.0 85 5/15/2026
0.3.0 92 5/14/2026
0.2.0 85 5/14/2026
0.1.0 91 5/13/2026

v1.1.0 — program-trading support. The embedded TR catalog grows from 46 to 53 TRs (the /stock/program family). New internal chart-spec builders and an Analysis layer (ProgramFootprintAnalyzer) back the MCP server's program-trading tools; the public Core API is unchanged. Versioned in lockstep with RedoxNet.Mcp.LsOpenApi 1.1.0. See https://github.com/redoxnet/mcp-lsopenapi/blob/main/RELEASENOTES.Core.md for full notes.