RedoxNet.LsOpenApi.Core 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RedoxNet.LsOpenApi.Core --version 0.2.0
                    
NuGet\Install-Package RedoxNet.LsOpenApi.Core -Version 0.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="0.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="0.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 0.2.0
                    
#r "nuget: RedoxNet.LsOpenApi.Core, 0.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@0.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=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=RedoxNet.LsOpenApi.Core&version=0.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 — 13-TR seed 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).
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 — see ADR-001 for the rationale (MCP elicitation explicitly avoided for static secrets).

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.6.0 105 5/28/2026
1.5.1 111 5/27/2026
1.5.0 109 5/27/2026
1.4.0 95 5/26/2026
1.3.0 92 5/26/2026
1.2.0 100 5/22/2026
1.1.0 97 5/22/2026
1.0.0 105 5/21/2026
0.10.1 93 5/20/2026
0.10.0 94 5/20/2026
0.9.0 99 5/20/2026
0.8.0 103 5/20/2026
0.7.0 105 5/18/2026
0.6.0 105 5/16/2026
0.5.0 97 5/15/2026
0.4.0 95 5/15/2026
0.3.0 102 5/14/2026
0.2.0 96 5/14/2026
0.1.0 100 5/13/2026

v0.2.0: Packaging fix — the package README is now included on NuGet (v0.1.0 shipped without it). No code or API changes; the SDK is equivalent to v0.1.0. See https://github.com/redoxnet/mcp-lsopenapi/blob/main/RELEASENOTES.Core.md for full notes.