{"id":37047107,"url":"https://github.com/sajidmohammed88/robinhood-csharp","last_synced_at":"2026-01-14T05:32:44.129Z","repository":{"id":237569995,"uuid":"357292589","full_name":"sajidmohammed88/robinhood-csharp","owner":"sajidmohammed88","description":".NetCore package based on python robinhood API https://pyrh.readthedocs.io/en/latest/","archived":false,"fork":false,"pushed_at":"2025-01-25T10:45:11.000Z","size":178,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-21T19:52:45.122Z","etag":null,"topics":["csharp","robinhood-api"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sajidmohammed88.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["sajidmohammed88"]}},"created_at":"2021-04-12T18:07:03.000Z","updated_at":"2025-07-19T22:33:55.000Z","dependencies_parsed_at":"2024-07-30T02:32:56.618Z","dependency_job_id":"e1f739c6-2f94-485d-8342-ed386033bc5e","html_url":"https://github.com/sajidmohammed88/robinhood-csharp","commit_stats":null,"previous_names":["sajidmohammed88/robinhood-api","sajidmohammed88/robinhood-csharp"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sajidmohammed88/robinhood-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sajidmohammed88%2Frobinhood-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sajidmohammed88%2Frobinhood-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sajidmohammed88%2Frobinhood-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sajidmohammed88%2Frobinhood-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sajidmohammed88","download_url":"https://codeload.github.com/sajidmohammed88/robinhood-csharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sajidmohammed88%2Frobinhood-csharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28410628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","robinhood-api"],"created_at":"2026-01-14T05:32:43.612Z","updated_at":"2026-01-14T05:32:44.121Z","avatar_url":"https://github.com/sajidmohammed88.png","language":"C#","funding_links":["https://github.com/sponsors/sajidmohammed88"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n\u003cimg src=\".github\\robinhood-csharp.png\"\u003e\r\n\u003c/p\u003e\r\n\r\n# Introduction \r\n.NetCore package to make trades with Unofficial Robinhood API.\r\n\u003cbr\u003e\r\nSee @Sanko's [Unofficial Documentation](https://github.com/sanko/Robinhood) for more information.\r\n\r\n# Getting Started\r\n1. Install the package from GitHub packages or NuGet packages\r\n```\r\ndotnet add package robinhood-csharp\r\n```\r\n2. Create Authentication section configuration in your project that call this package\r\n\r\nIn order to get device token, follow https://stackoverflow.com/a/64775021\r\n\r\n```\r\n\"RobinhoodAuthentication\": {\r\n    //UserName is email format\r\n    \"UserName\": \"**********\", \r\n    \"Password\": \"**********\",\r\n    \"ExpirationTime\": 734000,\r\n    \"Timeout\": 5,\r\n    \"ChallengeType\": \"sms\",\r\n    \"DeviceToken\": \"**********\"\r\n  }\r\n```\r\n\r\n3. Add the configuration needed for the package in ``Program.cs``\r\n    1. REST API\r\n        ```\r\n        builder.Services.ConfigureRb(builder.Configuration.GetSection(\"RobinhoodAuthentication\"))\r\n        ```\r\n    1. Console APP\r\n        ```\r\n        private static IConfiguration _configuration;\r\n        private static IServiceProvider _serviceProvider;\r\n\r\n        private static IHostBuilder CreateHostBuilder(string[] args)\r\n        {\r\n            return Host.CreateDefaultBuilder(args)\r\n                .ConfigureHostConfiguration(AddConfiguration)\r\n                .ConfigureServices(services =\u003e\r\n                {\r\n                    services.ConfigureRb(_configuration.GetSection(\"RobinhoodAuthentication\"));\r\n                    _serviceProvider = services.BuildServiceProvider();\r\n                });\r\n        }\r\n\r\n        private static void AddConfiguration(IConfigurationBuilder builder)\r\n        {\r\n            IConfigurationBuilder configurationBuilder =\r\n                builder\r\n                    .SetBasePath(Directory.GetCurrentDirectory())\r\n                    .AddJsonFile(\"appsettings.json\", false, true);\r\n\r\n            _configuration = configurationBuilder.Build();\r\n        }\r\n        \r\n        ```\r\n\r\n4. Inject ``IRobinhood`` Interface\r\n\r\n5. Call login method\r\n```\r\nAuthenticationResponse authResponse = await _robinhood.LoginAsync();\r\n```\r\n6. Manage challenge case\r\n```\r\nif (authResponse.IsChallenge)\r\n{\r\n    do\r\n    {\r\n        Challenge challenge = authResponse.Challenge;\r\n\r\n        Console.WriteLine($\"Input challenge code from {challenge.Type} ({challenge.RemainingAttempts}/{challenge.RemainingRetries}):\");\r\n        string code = Console.ReadLine();\r\n\r\n        authResponse = await _robinhood.ChallengeOauth2Async(challenge.Id, code);\r\n    } while (authResponse.IsChallenge \u0026\u0026 authResponse.Challenge.CanRetry);\r\n}\r\n```\r\n\r\n7. Manage Mfa case\r\n```\r\nif (authResponse.MfaRequired)\r\n{\r\n    int attempts = 3;\r\n    (HttpStatusCode statusCode, AuthenticationResponse mfaAuth) mfaResponse;\r\n    do\r\n    {\r\n        Console.WriteLine($\"Input the MFA code:\");\r\n        string code = Console.ReadLine();\r\n\r\n        mfaResponse = await _robinhood.MfaOath2Async(code);\r\n        attempts--;\r\n    } while (attempts \u003e 0 \u0026\u0026 mfaResponse.statusCode != HttpStatusCode.OK);\r\n\r\n    authResponse = mfaResponse.mfaAuth;\r\n}\r\n\r\n```\r\n8. Configure the token expiration date, refresh token and Authorization header by calling ConfigureManager method\r\n```\r\n_robinhood.ConfigureManager(authResponse);\r\n```\r\n\r\n# Samples and tests\r\n- Check user information example : \r\n```\r\nUser user = await _robinhood.GetUserAsync();\r\n```\r\n- Find tests examples for all routes under **samples/RbConsoleApp** project.\r\n- Find one test example for REST API under **samples/RbWebApi** project.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsajidmohammed88%2Frobinhood-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsajidmohammed88%2Frobinhood-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsajidmohammed88%2Frobinhood-csharp/lists"}