{"id":21098208,"url":"https://github.com/timothymakkison/yahoo-finance-api-console-application","last_synced_at":"2026-05-19T18:36:22.347Z","repository":{"id":116966932,"uuid":"352426690","full_name":"TimothyMakkison/Yahoo-Finance-Api-Console-Application","owner":"TimothyMakkison","description":"A simple Yahoo Finance api console application to learn various libraries.","archived":false,"fork":false,"pushed_at":"2022-05-02T13:56:33.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T21:30:21.425Z","etag":null,"topics":["automapper","commandline","commandlineparser","csharp","dependency-injection","fluentvalidation","mediatr","refit"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimothyMakkison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-03-28T20:03:28.000Z","updated_at":"2023-01-02T04:15:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd318033-b848-4c8d-ab89-853cf967e7ae","html_url":"https://github.com/TimothyMakkison/Yahoo-Finance-Api-Console-Application","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TimothyMakkison/Yahoo-Finance-Api-Console-Application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMakkison%2FYahoo-Finance-Api-Console-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMakkison%2FYahoo-Finance-Api-Console-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMakkison%2FYahoo-Finance-Api-Console-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMakkison%2FYahoo-Finance-Api-Console-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimothyMakkison","download_url":"https://codeload.github.com/TimothyMakkison/Yahoo-Finance-Api-Console-Application/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMakkison%2FYahoo-Finance-Api-Console-Application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33227502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["automapper","commandline","commandlineparser","csharp","dependency-injection","fluentvalidation","mediatr","refit"],"created_at":"2024-11-19T22:54:02.147Z","updated_at":"2026-05-19T18:36:22.314Z","avatar_url":"https://github.com/TimothyMakkison.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yahoo Finance Api Console App\nA simple Yahoo Finance api console application to learn various libraries. Contains simple functions to query stock prices and summaries.\n\n![image](https://user-images.githubusercontent.com/49349513/112772453-cef22780-9028-11eb-92be-755d615fff7b.png)\n\n# Example Usage\nIn this example the historic price for Tesla is retrieved.\n![image](https://user-images.githubusercontent.com/49349513/112772710-36f53d80-902a-11eb-8483-1888c6399ee7.png)\n\n# Behavior\n* When run, the app immediately calls `Startup.BuildService()`. This behaves similarly to an Asp.Net `Startup` call by loading a configuration and then building a 'ServiceCollection' by adding services.\n```\nservices.AddMediatR(typeof(Program));\nservices.AddAutoMapper(typeof(Program));\nservices.AddCommandLineParser(typeof(Program));\nservices.AddTransient(typeof(IPipelineBehavior\u003c,\u003e), typeof(ValidationBehavior\u003c,\u003e));\nservices.AddValidatorsFromAssembly(typeof(Program).Assembly);\n\nBuildRefitclient(configuration, services);\nservices.AddSingleton\u003cCommandLineParser\u003e();\n```\n* In `Program` the service collection is used to build an instance of `CommandLineParser` and args are passed to it.\n* `CommandLineParser` parses the args, either printing an error/providing help or constructing an object.\n* The object is passed to the `IMediator` instance and sent.\n* If the object has a registered handler then it enters the mediator pipeline.\n* Inside `AbstractValidator` validators matching the object type are applied, either throwing an error if validation fails or passing it to the handler.\n* The corresponding handler constructs an api request and awaits a response.\n* If the response is Ok then the response is mapped to a result type and returned. \n\n\n# Libraries used:\n* Microsoft.Extensions.Configuration\n  - Used to load appSettings.json containing the API base address, secrets and host.\n* Microsoft.Extensions.DependencyInjection\n  - Scans assembly for types and creates a service provider.\n* CommandLineParser\n  - Handles parsing input arguments into objects and providing a basic ux - help text, error messages etc. \n* Refit\n  - When configured automatically turns an interface into a REST Api client.\n  - Used to create IStockApi.\n* MediatR \n  - Mediator pattern library, Mediator.Extensions.Microsoft.DependencyInjection automatically gets all valid handlers.\n  - Receives request objects and sends them to a valid handler. Handlers send a HTTP request and map the response to a result.\n  - Supports pipeline behavior to validate the requests before sending it.\n* FluentValidation\n  - By creating a custom IPipelineBehavior ValidationBehavior class we can requests validate being sent through MediatR.\n  - Validation is performed using FluentValidation in custom classes inheriting from AbstractValidator.\n  - Validators are scanned for when building services using FluentValidation.DependencyInjection, Validators are then injected into the custom ValidationBehavior class.\n* AutoMapper\n  - Scans the assembly for Profiles containing mapping rules.\n  - IMapper takes objects and attempts to map into different types.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothymakkison%2Fyahoo-finance-api-console-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothymakkison%2Fyahoo-finance-api-console-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothymakkison%2Fyahoo-finance-api-console-application/lists"}