RobinStocks 1.0.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package RobinStocks --version 1.0.1
                    
NuGet\Install-Package RobinStocks -Version 1.0.1
                    
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="RobinStocks" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RobinStocks" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="RobinStocks" />
                    
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 RobinStocks --version 1.0.1
                    
#r "nuget: RobinStocks, 1.0.1"
                    
#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 RobinStocks@1.0.1
                    
#: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=RobinStocks&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=RobinStocks&version=1.0.1
                    
Install as a Cake Tool

RobinStocks

NuGet .NET License: MIT

A C# client library for the Robinhood brokerage API. Provides strongly-typed services for stocks, options, futures, crypto, orders, accounts, and market data.

Disclaimer: Robinhood does not publish an official public API. This library is based on reverse-engineered endpoints and may break without notice if Robinhood changes their API.


Install

dotnet add package RobinStocks

Quick Start

using RobinStocks;

// Create a client
var client = RobinStocksBuilder.CreateRobinhoodClient();

// Login (stored tokens are reused automatically on subsequent runs)
var success = await client.LoginAsync("your@email.com", "yourpassword");
if (!success)
{
    Console.WriteLine("Login failed — check credentials or approve in the Robinhood app.");
    return;
}

// Get a stock quote
var quote = await client.Stocks.GetQuoteAsync("AAPL");
Console.WriteLine($"AAPL: ${quote?.LastTradePrice}");

// Get options chain
var chain = await client.Options.GetOptionChainAsync("AAPL");

// Get account positions
var positions = await client.Account.GetPositionsAsync();

await client.LogoutAsync();

Authentication

Robinhood requires device approval for new logins. The first time you authenticate on a new machine, you will be prompted to approve the login in the Robinhood mobile app.

After the first successful login, the access token is stored at ~/.tokens/robinhood.json and reused automatically on subsequent runs — no re-approval needed unless the token expires.

TOTP / Authenticator App

If you have two-factor authentication enabled via an authenticator app, pass your TOTP secret:

await client.LoginAsync("your@email.com", "yourpassword", totpSecret: "YOUR_TOTP_SECRET");

MFA Code (SMS)

If you receive an SMS code, pass it directly:

await client.LoginAsync("your@email.com", "yourpassword", mfaCode: "123456");

Token Refresh

Tokens are valid for 24 hours. To refresh programmatically:

if (client.TokenExpiryTime < DateTime.UtcNow.AddMinutes(10))
    await client.RefreshTokenAsync();

Token Change Hook

Subscribe to token changes to persist tokens externally (e.g. to a Kubernetes secret):

var authService = /* resolve RobinhoodAuthenticationService from DI */;
authService.OnTokenRefreshed += async tokenData =>
{
    // persist tokenData.AccessToken, tokenData.RefreshToken, etc.
};

Dependency Injection (ASP.NET)

// Program.cs
builder.Services.AddRobinStocks();

// Inject RobinhoodClient wherever needed
public class MyService(RobinhoodClient client) { ... }

Services

Property Description
client.Stocks Quotes, historicals, fundamentals, instrument search, news, ratings
client.Options Option chains, instruments, market data, positions, orders
client.Orders Place, cancel, and list equity orders
client.Account Positions, portfolio, watchlists, bank accounts, dividends
client.Crypto Crypto quotes, orders, holdings, currency pairs
client.Markets Market hours, top movers, market categories
client.Profiles User profile, investment profile, employment info
client.TradingTrends Retail sentiment, hedge fund activity, insider transactions
client.Futures Futures contracts, quotes, historicals, margin, orders

Architecture

RobinhoodClient
├── StocksService       → api.robinhood.com
├── OptionsService      → api.robinhood.com
├── OrdersService       → api.robinhood.com
├── AccountService      → api.robinhood.com
├── MarketsService      → api.robinhood.com
├── ProfilesService     → api.robinhood.com
├── TradingTrendsService→ api.robinhood.com
├── CryptoService       → nummus.robinhood.com
└── FuturesService      → api.robinhood.com (arsenal/ceres)

All services share a single HttpClientService that manages the Bearer token and handles auth-stripping for OAuth endpoints.


License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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