├── .config └── dotnet-tools.json ├── .gitattributes ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── codeql.yml │ ├── release.yml │ └── stale.yml ├── .gitignore ├── Configuration.xml ├── LICENSE.txt ├── OoplesFinance.YahooFinanceAPI.sln ├── README.md ├── src ├── Enums │ ├── Country.cs │ ├── DataFrequency.cs │ ├── DataType.cs │ ├── Language.cs │ ├── ScreenerType.cs │ ├── TimeInterval.cs │ ├── TimeRange.cs │ └── YahooModule.cs ├── Helpers │ ├── AllHistoricalHelper.cs │ ├── AnalystHelper.cs │ ├── AssetProfileHelper.cs │ ├── AutoCompleteHelper.cs │ ├── BalanceSheetHistoryHelper.cs │ ├── BalanceSheetHistoryQuarterlyHelper.cs │ ├── CalendarEventsHelper.cs │ ├── CapitalGainHelper.cs │ ├── CashflowStatementHistoryHelper.cs │ ├── CashflowStatementHistoryQuarterlyHelper.cs │ ├── ChartHelper.cs │ ├── CrumbHelper.cs │ ├── DateTimeHelper.cs │ ├── DividendHelper.cs │ ├── DownloadHelper.cs │ ├── EarningsHelper.cs │ ├── EarningsHistoryHelper.cs │ ├── EarningsTrendHelper.cs │ ├── EsgScoresHelper.cs │ ├── ExternalInit.cs │ ├── FinancialDataHelper.cs │ ├── FundOwnershipHelper.cs │ ├── FundProfileHelper.cs │ ├── HistoricalHelper.cs │ ├── IncomeStatementHistoryHelper.cs │ ├── IncomeStatementHistoryQuarterlyHelper.cs │ ├── IndexTrendHelper.cs │ ├── InsiderHolderHelper.cs │ ├── InsiderTransactionHelper.cs │ ├── InsightsHelper.cs │ ├── InstitutionHelper.cs │ ├── InstitutionOwnershipHelper.cs │ ├── KeyStatisticsHelper.cs │ ├── MajorDirectHoldersHelper.cs │ ├── MajorHoldersBreakdownHelper.cs │ ├── MarketSummaryHelper.cs │ ├── NetSharePurchaseActivityHelper.cs │ ├── PriceHelper.cs │ ├── QuoteTypeHelper.cs │ ├── RealTimeQuoteHelper.cs │ ├── RecommendationHelper.cs │ ├── RecommendationTrendHelper.cs │ ├── ScreenerHelper.cs │ ├── SecFilingsHelper.cs │ ├── SectorTrendHelper.cs │ ├── SparkChartHelper.cs │ ├── StockSplitHelper.cs │ ├── StocksOwnedHelper.cs │ ├── SummaryDetailsHelper.cs │ ├── TrendingHelper.cs │ ├── TrendingStocksHelper.cs │ ├── UpgradeDowngradeHistoryHelper.cs │ ├── UrlHelper.cs │ └── Usings.cs ├── Images │ └── Favicon.jpg ├── Interfaces │ ├── YahooCsvBase.cs │ └── YahooJsonBase.cs ├── IsExternalInit.cs ├── Models │ ├── AnalystData.cs │ ├── AssetProfileData.cs │ ├── AutoCompleteData.cs │ ├── BalanceSheetHistoryData.cs │ ├── BalanceSheetHistoryQuarterlyData.cs │ ├── CalendarEventsData.cs │ ├── CapitalGainData.cs │ ├── CashFlowStatementHistoryData.cs │ ├── CashflowStatementHistoryQuarterlyData.cs │ ├── ChartData.cs │ ├── DayGainersLosersData.cs │ ├── DividendData.cs │ ├── EarningsData.cs │ ├── EarningsHistoryData.cs │ ├── EarningsTrendData.cs │ ├── EsgScoresData.cs │ ├── FinancialData.cs │ ├── FundOwnershipData.cs │ ├── FundProfileData.cs │ ├── HistoricalData.cs │ ├── IncomeStatementHistoryData.cs │ ├── IncomeStatementHistoryQuarterlyData.cs │ ├── IndexTrendData.cs │ ├── InsiderHolderData.cs │ ├── InsiderTransactionData.cs │ ├── InsightsData.cs │ ├── InstitutionData.cs │ ├── InstitutionOwnershipData.cs │ ├── KeyStatisticData.cs │ ├── MajorDirectHoldersData.cs │ ├── MajorHoldersBreakdownData.cs │ ├── MarketSummaryData.cs │ ├── NetSharePurchaseActivityData.cs │ ├── PriceData.cs │ ├── QuoteTypeData.cs │ ├── RealTimeQuoteData.cs │ ├── RecommendData.cs │ ├── RecommendationTrendData.cs │ ├── SecFilingsData.cs │ ├── SectorTrendData.cs │ ├── SparkChartData.cs │ ├── StockSplitData.cs │ ├── StocksOwnedData.cs │ ├── SummaryData.cs │ ├── TrendingData.cs │ ├── TrendingStocksData.cs │ └── UpgradeDowngradeHistoryData.cs ├── OoplesFinance.YahooFinanceAPI.csproj └── YahooClient.cs └── tests ├── TestConsoleApp ├── Program.cs └── TestConsoleApp.csproj └── UnitTests ├── OoplesFinance.YahooFinanceAPI.Tests.Unit.csproj ├── Usings.cs └── YahooClientTests.cs /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "jetbrains.dotcover.globaltool": { 6 | "version": "2023.2.5", 7 | "commands": [ 8 | "dotnet-dotcover" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: ooples 4 | patreon: cheatcountry 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: cheatcountry 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: cheatcountry 10 | issuehunt: ooples 11 | otechie: cheatcountry 12 | custom: ["https://www.paypal.me/cheatcountry", "https://www.buymeacoffee.com/cheatcountry"] 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "nuget" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: CodeQL Analyis 2 | 3 | on: 4 | push: 5 | pull_request: 6 | branches: [ develop ] 7 | schedule: 8 | - cron: '0 8 * * 1' 9 | 10 | jobs: 11 | analyze: 12 | name: Analyze 13 | runs-on: ubuntu-latest 14 | permissions: 15 | actions: read 16 | contents: read 17 | security-events: write 18 | 19 | strategy: 20 | fail-fast: false 21 | matrix: 22 | language: [ 'csharp', 'javascript' ] 23 | 24 | steps: 25 | - name: Checkout repository 26 | uses: actions/checkout@v4 27 | 28 | - name: Setup .NET 8.0.x 29 | uses: actions/setup-dotnet@v3 30 | with: 31 | dotnet-version: '8.0.x' 32 | 33 | - name: Initialize CodeQL 34 | uses: github/codeql-action/init@v2 35 | with: 36 | languages: ${{ matrix.language }} 37 | 38 | - name: Cache NuGet Packages 39 | uses: actions/cache@v3 40 | with: 41 | path: ~/.nuget/packages 42 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} 43 | restore-keys: | 44 | ${{ runner.os }}-nuget- 45 | 46 | - name: Dotnet Build 47 | run: dotnet build -c Release 48 | 49 | - name: Perform CodeQL Analysis 50 | uses: github/codeql-action/analyze@v2 51 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Build and Release 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | name: Create Release 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: Checkout Code 12 | uses: actions/checkout@v3 13 | 14 | - name: Setup .NET 8.0.x 15 | uses: actions/setup-dotnet@v3 16 | with: 17 | dotnet-version: '8.0.x' 18 | 19 | - name: Cache NuGet Packages 20 | uses: actions/cache@v3 21 | with: 22 | path: ~/.nuget/packages 23 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} 24 | restore-keys: | 25 | ${{ runner.os }}-nuget- 26 | 27 | - name: Restore .NET Tools 28 | run: dotnet tool restore 29 | working-directory: ./tests/UnitTests 30 | 31 | - name: Dotnet Test (Debug) 32 | run: dotnet dotcover test --dcXML=Configuration.xml 33 | 34 | - name: Dotnet Build (Release) 35 | run: dotnet build -c Release 36 | 37 | - name: Save SDK Packages 38 | uses: actions/upload-artifact@v3 39 | with: 40 | name: sdk-packages 41 | path: | 42 | src/bin/Release/*.nupkg 43 | src/bin/Release/*.snupkg 44 | 45 | - name: Send Coverage to Codacy 46 | if: "${{env.CODACY_PROJECT_TOKEN != ''}}" 47 | env: 48 | CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} 49 | run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r OoplesFinance.YahooFinanceAPI.Coverage.xml 50 | 51 | publish-sdk: 52 | name: Publish SDK Binaries 53 | runs-on: ubuntu-latest 54 | needs: build 55 | if: github.repository == 'ooples/OoplesFinance.YahooFinanceAPI' 56 | 57 | steps: 58 | - name: Load SDK Packages 59 | uses: actions/download-artifact@v4.1.7 60 | with: 61 | name: sdk-packages 62 | 63 | - name: Create NuGet Version 64 | run: dotnet nuget push **.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} 65 | 66 | - name: Publish Github Packages 67 | uses: tanaka-takayoshi/nuget-publish-to-github-packages-action@v2.1 68 | with: 69 | nupkg-path: './artifacts/*.nupkg' 70 | repo-owner: 'ooples' 71 | gh-user: 'ooples' 72 | token: ${{ secrets.GITHUB_TOKEN }} 73 | 74 | - name: Create GitHub Release 75 | uses: softprops/action-gh-release@v1 76 | with: 77 | name: SDK ${{ github.ref }} 78 | draft: true 79 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. 2 | # 3 | # You can adjust the behavior by modifying this file. 4 | # For more information, see: 5 | # https://github.com/actions/stale 6 | name: Mark stale issues and pull requests 7 | 8 | on: 9 | schedule: 10 | - cron: '25 7 * * *' 11 | 12 | jobs: 13 | stale: 14 | 15 | runs-on: ubuntu-latest 16 | permissions: 17 | issues: write 18 | pull-requests: write 19 | 20 | steps: 21 | - uses: actions/stale@v5 22 | with: 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | stale-issue-message: 'Stale issue message' 25 | stale-pr-message: 'Stale pull request message' 26 | stale-issue-label: 'no-issue-activity' 27 | stale-pr-label: 'no-pr-activity' 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /Configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OoplesFinance.YahooFinanceAPI 7 | 8 | 9 | 10 | OoplesFinance.YahooFinanceAPI.Coverage.xml 11 | DetailedXml 12 | 13 | -------------------------------------------------------------------------------- /OoplesFinance.YahooFinanceAPI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33209.295 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OoplesFinance.YahooFinanceAPI", "src\OoplesFinance.YahooFinanceAPI.csproj", "{F783EAAC-E1BF-4AA9-B9C6-BC0F1519613F}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OoplesFinance.YahooFinanceAPI.Tests.Unit", "tests\UnitTests\OoplesFinance.YahooFinanceAPI.Tests.Unit.csproj", "{CECB02A3-7D31-4AE6-AB3E-52E46B62BF4B}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestConsoleApp", "tests\TestConsoleApp\TestConsoleApp.csproj", "{8FC9B783-0941-4623-BC98-AA31A8678808}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {F783EAAC-E1BF-4AA9-B9C6-BC0F1519613F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {F783EAAC-E1BF-4AA9-B9C6-BC0F1519613F}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {F783EAAC-E1BF-4AA9-B9C6-BC0F1519613F}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {F783EAAC-E1BF-4AA9-B9C6-BC0F1519613F}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {CECB02A3-7D31-4AE6-AB3E-52E46B62BF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {CECB02A3-7D31-4AE6-AB3E-52E46B62BF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {CECB02A3-7D31-4AE6-AB3E-52E46B62BF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {CECB02A3-7D31-4AE6-AB3E-52E46B62BF4B}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {8FC9B783-0941-4623-BC98-AA31A8678808}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {8FC9B783-0941-4623-BC98-AA31A8678808}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {8FC9B783-0941-4623-BC98-AA31A8678808}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {8FC9B783-0941-4623-BC98-AA31A8678808}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {ABAB5149-23B2-4D15-BD69-05993065166E} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /src/Enums/Country.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum Country 4 | { 5 | UnitedStates, 6 | Australia, 7 | Canada, 8 | France, 9 | Germany, 10 | HongKong, 11 | India, 12 | Italy, 13 | Spain, 14 | UnitedKingdom 15 | } 16 | -------------------------------------------------------------------------------- /src/Enums/DataFrequency.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum DataFrequency 4 | { 5 | Daily, 6 | Weekly, 7 | Monthly 8 | } 9 | -------------------------------------------------------------------------------- /src/Enums/DataType.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum DataType 4 | { 5 | HistoricalPrices, 6 | Dividends, 7 | StockSplits, 8 | CapitalGains, 9 | All 10 | } 11 | -------------------------------------------------------------------------------- /src/Enums/Language.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum Language 4 | { 5 | English, 6 | French, 7 | German, 8 | Italian, 9 | Mandarin, 10 | Spanish 11 | } 12 | -------------------------------------------------------------------------------- /src/Enums/ScreenerType.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum ScreenerType 4 | { 5 | AggressiveSmallCaps, 6 | AnalystStrongBuyStocks, 7 | BearishStocksRightNow, 8 | BullishStocksRightNow, 9 | ConservativeForeignFunds, 10 | DayGainers, 11 | DayLosers, 12 | GrowthTechnologyStocks, 13 | HighYieldBond, 14 | LatestAnalystUpgradedStocks, 15 | MorningstarFiveStarStocks, 16 | MostActives, 17 | MostInstitutionallyBoughtLargeCapStocks, 18 | MostInstitutionallyHeldLargeCapStocks, 19 | MostInstitutionallySoldLargeCapStocks, 20 | MostShortedStocks, 21 | PortfolioAnchors, 22 | SmallCapGainers, 23 | SolidLargeGrowthFunds, 24 | SolidMidcapGrowthFunds, 25 | StocksMostBoughtByHedgeFunds, 26 | StocksMostBoughtByPensionFunds, 27 | StocksMostBoughtByPrivateEquity, 28 | StocksMostBoughtBySovereignWealthFunds, 29 | StocksWithMostInstitutionalBuyers, 30 | StocksWithMostInstitutionalSellers, 31 | StrongUndervaluedStocks, 32 | TopMutualFunds, 33 | TopStocksOwnedByCathieWood, 34 | TopStocksOwnedByGoldmanSachs, 35 | TopStocksOwnedByRayDalio, 36 | TopStocksOwnedByWarrenBuffet, 37 | UndervaluedGrowthStocks, 38 | UndervaluedLargeCaps, 39 | UndervaluedWideMoatStocks, 40 | UpsideBreakoutStocksDaily 41 | } 42 | -------------------------------------------------------------------------------- /src/Enums/TimeInterval.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum TimeInterval 4 | { 5 | _1Minute, 6 | _2Minutes, 7 | _5Minutes, 8 | _15Minutes, 9 | _30Minutes, 10 | _60Minutes, 11 | _90Minutes, 12 | _1Hour, 13 | _1Day, 14 | _5Days, 15 | _1Week, 16 | _1Month, 17 | _3Months 18 | } 19 | -------------------------------------------------------------------------------- /src/Enums/TimeRange.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum TimeRange 4 | { 5 | _1Day, 6 | _5Days, 7 | _1Month, 8 | _3Months, 9 | _6Months, 10 | _1Year, 11 | _2Years, 12 | _5Years, 13 | _10Years, 14 | YearToDate, 15 | Max 16 | } 17 | -------------------------------------------------------------------------------- /src/Enums/YahooModule.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Enums; 2 | 3 | public enum YahooModule 4 | { 5 | AssetProfile, 6 | BalanceSheetHistory, 7 | BalanceSheetHistoryQuarterly, 8 | CalendarEvents, 9 | CashflowStatementHistory, 10 | CashflowStatementHistoryQuarterly, 11 | Earnings, 12 | EarningsHistory, 13 | EarningsTrend, 14 | EsgScores, 15 | FinancialData, 16 | FundOwnership, 17 | FundProfile, 18 | IncomeStatementHistory, 19 | IncomeStatementHistoryQuarterly, 20 | IndexTrend, 21 | InsiderHolders, 22 | InsiderTransactions, 23 | Insights, 24 | InstitutionOwnership, 25 | KeyStatistics, 26 | MajorDirectHolders, 27 | MajorHoldersBreakdown, 28 | NetSharePurchaseActivity, 29 | Price, 30 | QuoteType, 31 | RecommendationTrend, 32 | SecFilings, 33 | SectorTrend, 34 | SummaryDetails, 35 | UpgradeDowngradeHistory 36 | } 37 | -------------------------------------------------------------------------------- /src/Helpers/AllHistoricalHelper.cs: -------------------------------------------------------------------------------- 1 | // AllHistoricalHelper.cs 2 | // Andrew Baylis 3 | // Created: 12/10/2024 4 | 5 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 6 | 7 | internal class AllHistoricalHelper 8 | { 9 | #region Internal Methods 10 | 11 | internal HistoricalFullData ParseYahooJsonData(string jsonData) 12 | { 13 | var root = JsonConvert.DeserializeObject(jsonData)?.Chart?.Result.FirstOrDefault() ?? 14 | throw new InvalidOperationException("No data available from Yahoo Finance"); 15 | 16 | var result = new HistoricalFullData {Meta = root.Meta}; 17 | 18 | for (var i = 0; i < root.Timestamp.Count; i++) 19 | { 20 | result.Prices.Add(new HistoricalChartInfo 21 | { 22 | Meta = root.Meta, 23 | Date = root.Timestamp[i].GetValueOrDefault().FromUnixTimeStamp(), 24 | Open = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.Open[i] ?? 0, 4), 25 | High = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.High[i] ?? 0, 4), 26 | Low = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.Low[i] ?? 0, 4), 27 | Close = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.Close[i] ?? 0, 4), 28 | AdjustedClose = Math.Round(root.Indicators?.Adjclose.FirstOrDefault()?.Adjclose[i] ?? 0, 4), 29 | Volume = root.Indicators?.Quote.FirstOrDefault()?.Volume[i] ?? 0 30 | }); 31 | } 32 | 33 | if (result.Prices.Count == 0) 34 | { 35 | throw new InvalidOperationException("Requested Information Not Available On Yahoo Finance"); 36 | } 37 | 38 | if (root.Events.DividendData.Count > 0) 39 | { 40 | foreach (var dividend in root.Events.DividendData) 41 | { 42 | result.Dividends.Add(new DividendInfo(dividend.Value)); 43 | } 44 | } 45 | 46 | if (root.Events.SplitData.Count > 0) 47 | { 48 | foreach (var split in root.Events.SplitData) 49 | { 50 | result.Splits.Add(new SplitInfo(split.Value)); 51 | } 52 | } 53 | 54 | return result; 55 | } 56 | 57 | #endregion 58 | } -------------------------------------------------------------------------------- /src/Helpers/AnalystHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class AnalystHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Analyst data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var analystData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return analystData != null ? (IEnumerable)analystData.Finance.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/AssetProfileHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class AssetProfileHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Asset Profile data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var assetProfile = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return assetProfile != null ? (IEnumerable)assetProfile.QuoteSummary.Results.Select(x => x.AssetProfile) : []; 16 | } 17 | } -------------------------------------------------------------------------------- /src/Helpers/AutoCompleteHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class AutoCompleteHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the AutoComplete data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var autoComplete = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return autoComplete != null ? (IEnumerable)autoComplete.ResultSet.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/BalanceSheetHistoryHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class BalanceSheetHistoryHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Balance Sheet History data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var balanceSheetHistory = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return balanceSheetHistory != null ? (IEnumerable)balanceSheetHistory.QuoteSummary.Results. 16 | Select(x => x.BalanceSheetHistory).First().BalanceSheetStatements : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/BalanceSheetHistoryQuarterlyHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class BalanceSheetHistoryQuarterlyHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Balance Sheet History Quarterly data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var balanceSheetHistoryQuarterlyData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return balanceSheetHistoryQuarterlyData != null ? (IEnumerable)balanceSheetHistoryQuarterlyData.QuoteSummary.Results. 16 | Select(x => x.BalanceSheetHistoryQuarterly).First().BalanceSheetStatements : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/CalendarEventsHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class CalendarEventsHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Calendar Events data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var calendarEvents = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return calendarEvents != null ? (IEnumerable)calendarEvents.QuoteSummary.Results.Select(x => x.CalendarEvents) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/CapitalGainHelper.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 4 | 5 | internal class CapitalGainHelper : YahooJsonBase 6 | { 7 | internal override IEnumerable ParseYahooJsonData(string jsonData) 8 | { 9 | var capitalGain = JsonConvert.DeserializeObject(jsonData); 10 | 11 | if (capitalGain != null && capitalGain.Chart?.Result != null) 12 | { 13 | var result = capitalGain.Chart.Result.Cast(); 14 | 15 | return result; 16 | } 17 | 18 | return []; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Helpers/CashflowStatementHistoryHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class CashflowStatementHistoryHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Cashflow Statement History data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var balanceSheetHistory = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return balanceSheetHistory != null ? (IEnumerable)balanceSheetHistory.QuoteSummary.Results. 16 | Select(x => x.CashflowStatementHistory).First().CashflowStatements : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/CashflowStatementHistoryQuarterlyHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class CashflowStatementHistoryQuarterlyHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Cashflow Statement History Quarterly data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var cashflowStatementHistoryQuarterlyData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return cashflowStatementHistoryQuarterlyData != null ? (IEnumerable)cashflowStatementHistoryQuarterlyData.QuoteSummary.Results. 16 | Select(x => x.CashflowStatementHistoryQuarterly).First().CashflowStatements : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/ChartHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class ChartHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Chart data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var root = JsonConvert.DeserializeObject(jsonData)?.Chart.Result.FirstOrDefault(); 14 | 15 | var result = new ChartInfo 16 | { 17 | DateList = new List(root != null ? root.Timestamp.Select(x => x.FromUnixTimeStamp()) : []), 18 | CloseList = new List(root != null ? root.Indicators?.Quote.SelectMany(x => x.Close.Select(y => y.GetValueOrDefault())) ?? [] : []), 19 | OpenList = new List(root != null ? root.Indicators?.Quote.SelectMany(x => x.Open.Select(y => y.GetValueOrDefault())) ?? [] : []), 20 | HighList = new List(root != null ? root.Indicators?.Quote.SelectMany(x => x.High.Select(y => y.GetValueOrDefault())) ?? [] : []), 21 | VolumeList = new List(root != null ? root.Indicators?.Quote.SelectMany(x => x.Volume.Select(y => y.GetValueOrDefault())) ?? [] : []), 22 | LowList = new List(root != null ? root.Indicators?.Quote.SelectMany(x => x.Low.Select(y => y.GetValueOrDefault())) ?? [] : []) 23 | }; 24 | 25 | if (result.DateList.Count == 0 || result.CloseList.Count == 0 || result.OpenList.Count == 0 || result.HighList.Count == 0 || 26 | result.VolumeList.Count == 0 || result.LowList.Count == 0) 27 | { 28 | throw new InvalidOperationException("Requested Information Not Available On Yahoo Finance"); 29 | } 30 | 31 | return new[] { result }.Cast(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Helpers/CrumbHelper.cs: -------------------------------------------------------------------------------- 1 | // CrumbHelper.cs 2 | // Andrew Baylis 3 | // Created: 29/10/2024 4 | 5 | #region using 6 | 7 | using System.Runtime.CompilerServices; 8 | 9 | #endregion 10 | 11 | [assembly: InternalsVisibleTo("OoplesFinance.YahooFinanceAPI.Tests.Unit")] 12 | 13 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 14 | 15 | internal sealed class CrumbHelper 16 | { 17 | #region Fields 18 | 19 | private static CrumbHelper? _instance; 20 | 21 | internal static HttpMessageHandler? handler; 22 | private List cookies = []; 23 | 24 | #endregion 25 | 26 | private CrumbHelper() 27 | { 28 | handler = GetClientHandler(); 29 | Crumb = string.Empty; 30 | } 31 | 32 | #region Properties 33 | 34 | /// 35 | /// Crumb value for the Yahoo Finance API 36 | /// 37 | internal string Crumb { get; private set; } 38 | 39 | /// 40 | /// Single instance of the CrumbHelper 41 | /// 42 | private static CrumbHelper Instance 43 | { 44 | get { return _instance ??= new CrumbHelper(); } 45 | } 46 | 47 | #endregion 48 | 49 | #region Static Methods 50 | 51 | public static HttpClient GetHttpClient() 52 | { 53 | HttpClient client = new(handler ?? GetClientHandler()); 54 | client.DefaultRequestHeaders.Add("Cookie", Instance.cookies); 55 | client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"); 56 | client.DefaultRequestHeaders.Add("Cache-Control", "no-cache"); 57 | client.DefaultRequestHeaders.Add("Connection", "keep-alive"); 58 | client.DefaultRequestHeaders.Add("Pragma", "no-cache"); 59 | client.DefaultRequestHeaders.Add("Upgrade-Insecure-Requests", "1"); 60 | 61 | return client; 62 | } 63 | 64 | public static async Task GetInstance(bool setCrumb = true) 65 | { 66 | if (string.IsNullOrEmpty(Instance.Crumb) && setCrumb) 67 | { 68 | await Instance.SetCrumbAsync(); 69 | } 70 | 71 | return Instance; 72 | } 73 | 74 | private static HttpClientHandler GetClientHandler() 75 | { 76 | return YahooClient.IsThrottled 77 | ? new DownloadThrottleQueueHandler(40, TimeSpan.FromMinutes(1),4) //40 calls in a minute, no more than 4 simultaneously 78 | : new HttpClientHandler(); 79 | } 80 | 81 | #endregion 82 | 83 | #region Public Methods 84 | 85 | public async Task SetCrumbAsync() 86 | { 87 | var client = GetHttpClient(); 88 | var loginResponse = await client.GetAsync("https://login.yahoo.com/"); 89 | 90 | if (loginResponse.IsSuccessStatusCode) 91 | { 92 | var login = await loginResponse.Content.ReadAsStringAsync(); 93 | if (loginResponse.Headers.TryGetValues("Set-Cookie", out var setCookie)) 94 | { 95 | cookies = new List(setCookie.Where(c => c.ToLower().IndexOf("domain=.yahoo.com") > 0)); 96 | var crumbResponse = await client.GetAsync("https://query1.finance.yahoo.com/v1/test/getcrumb"); 97 | 98 | if (crumbResponse.IsSuccessStatusCode) 99 | { 100 | Crumb = await crumbResponse.Content.ReadAsStringAsync(); 101 | } 102 | } 103 | } 104 | 105 | if (string.IsNullOrEmpty(Crumb)) 106 | { 107 | throw new Exception("Failed to get crumb"); 108 | } 109 | } 110 | 111 | #endregion 112 | 113 | #region Internal Methods 114 | 115 | internal void Destroy() 116 | { 117 | _instance = null; 118 | } 119 | 120 | #endregion 121 | } 122 | 123 | internal class DownloadThrottleQueueHandler : HttpClientHandler 124 | { 125 | #region Fields 126 | 127 | private readonly TimeSpan _maxPeriod; 128 | private readonly SemaphoreSlim _throttleLoad, _throttleRate; 129 | 130 | #endregion 131 | 132 | public DownloadThrottleQueueHandler(int maxPerPeriod, TimeSpan maxPeriod, int maxParallel = -1) 133 | { 134 | if (maxParallel < 0 || maxParallel > maxPerPeriod) 135 | { 136 | maxParallel = maxPerPeriod; 137 | } 138 | 139 | _throttleLoad = new SemaphoreSlim(maxParallel, maxParallel); 140 | _throttleRate = new SemaphoreSlim(maxPerPeriod, maxPerPeriod); 141 | _maxPeriod = maxPeriod; 142 | } 143 | 144 | #region Override Methods 145 | 146 | protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 147 | { 148 | await _throttleLoad.WaitAsync(cancellationToken); // Allow bursts up to maxParallel requests at once 149 | cancellationToken.ThrowIfCancellationRequested(); 150 | try 151 | { 152 | await _throttleRate.WaitAsync(cancellationToken); 153 | 154 | // Release after period [Note: Intentionally not awaited] 155 | // - Do not allow more than maxPerPeriod requests per period 156 | _ = Task.Delay(_maxPeriod).ContinueWith(tt => { _throttleRate.Release(1); }, cancellationToken); 157 | cancellationToken.ThrowIfCancellationRequested(); 158 | return await base.SendAsync(request, cancellationToken); 159 | } 160 | finally 161 | { 162 | _throttleLoad.Release(); 163 | } 164 | } 165 | 166 | #endregion 167 | } -------------------------------------------------------------------------------- /src/Helpers/DateTimeHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | public static class DateTimeHelper 4 | { 5 | /// 6 | /// Converts a date to the Unix format which is the amount of seconds since Jan 1, 1970 7 | /// 8 | /// 9 | /// 10 | public static long ToUnixTimestamp(this DateTime dateTime) 11 | { 12 | return new DateTimeOffset(dateTime).ToUnixTimeSeconds(); 13 | } 14 | 15 | /// 16 | /// Converts a data from the Unix format which is the amount of seconds since Jan 1, 1970 to a normal date 17 | /// 18 | /// 19 | /// 20 | public static DateTime FromUnixTimeStamp(this long unixTimestamp) 21 | { 22 | return DateTimeOffset.FromUnixTimeSeconds(unixTimestamp).DateTime; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Helpers/DividendHelper.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 3 | 4 | internal class DividendHelper : YahooJsonBase 5 | { 6 | internal override IEnumerable ParseYahooJsonData(string jsonData) 7 | { 8 | var dividendData = JsonConvert.DeserializeObject(jsonData); 9 | 10 | if (dividendData != null && dividendData.Chart?.Result != null) 11 | { 12 | var results = dividendData.Chart.Result.Cast(); 13 | 14 | return results; 15 | } 16 | 17 | return []; 18 | } 19 | } -------------------------------------------------------------------------------- /src/Helpers/EarningsHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class EarningsHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Earnings data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var earnings = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return earnings != null ? (IEnumerable)earnings.QuoteSummary.Results.Select(x => x.Earnings) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/EarningsHistoryHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class EarningsHistoryHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Earnings History data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var earningsHistory = JsonConvert.DeserializeObject(jsonData); 14 | var result = earningsHistory != null ? (IEnumerable?)earningsHistory.QuoteSummary.Results.Select(x => x.EarningsHistory).FirstOrDefault()?.History : []; 15 | 16 | return result ?? []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/EarningsTrendHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class EarningsTrendHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Earnings Trend data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var earningsTrend = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return earningsTrend != null ? (IEnumerable)earningsTrend.QuoteSummary.Results. 16 | Select(x => x.EarningsTrend).First().Trends : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/EsgScoresHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class EsgScoresHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Esg Scores data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var esgScores = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return esgScores != null ? (IEnumerable)esgScores.QuoteSummary.Results.Select(x => x.EsgScores) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/ExternalInit.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal static class IsExternalInit { } 4 | -------------------------------------------------------------------------------- /src/Helpers/FinancialDataHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class FinancialDataHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Financial Data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var financialData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return financialData != null ? (IEnumerable)financialData.QuoteSummary.Results.Select(x => x.FinancialData) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/FundOwnershipHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class FundOwnershipHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Fund Ownership data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var fundOwnership = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return fundOwnership != null ? (IEnumerable)fundOwnership.QuoteSummary.Results.Select(x => x.FundOwnership).First().OwnershipList : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/FundProfileHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class FundProfileHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Fund Profile data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var fundProfile = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return fundProfile != null ? (IEnumerable)fundProfile.QuoteSummary.Results.Select(x => x.FundProfile) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/HistoricalHelper.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 3 | 4 | internal class HistoricalHelper : YahooJsonBase 5 | { 6 | /// 7 | /// Parses the raw json data for the Financial Data 8 | /// 9 | /// 10 | /// 11 | /// 12 | internal override IEnumerable ParseYahooJsonData(string jsonData) 13 | { 14 | var root = (JsonConvert.DeserializeObject(jsonData)?.Chart?.Result.FirstOrDefault()) ?? 15 | throw new InvalidOperationException("No data available from Yahoo Finance"); 16 | var historicalChartInfoList = new List(); 17 | 18 | for (int i = 0; i < root.Timestamp.Count; i++) 19 | { 20 | historicalChartInfoList.Add(new HistoricalChartInfo 21 | { 22 | Date = root.Timestamp[i].GetValueOrDefault().FromUnixTimeStamp(), 23 | Open = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.Open[i] ?? 0, 4), 24 | High = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.High[i] ?? 0, 4), 25 | Low = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.Low[i] ?? 0, 4), 26 | Close = Math.Round(root.Indicators?.Quote.FirstOrDefault()?.Close[i] ?? 0, 4), 27 | AdjustedClose = Math.Round(root.Indicators?.Adjclose.FirstOrDefault()?.Adjclose[i] ?? 0, 4), 28 | Volume = root.Indicators?.Quote.FirstOrDefault()?.Volume[i] ?? 0 29 | }); 30 | } 31 | 32 | if (historicalChartInfoList.Count == 0) 33 | { 34 | throw new InvalidOperationException("Requested Information Not Available On Yahoo Finance"); 35 | } 36 | 37 | return historicalChartInfoList.Cast(); 38 | } 39 | } -------------------------------------------------------------------------------- /src/Helpers/IncomeStatementHistoryHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class IncomeStatementHistoryHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Income Statement History data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var incomeStatementHistory = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return incomeStatementHistory != null ? (IEnumerable)incomeStatementHistory.QuoteSummary.Results. 16 | Select(x => x.IncomeStatementHistory).First().IncomeStatementHistoryInfo : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/IncomeStatementHistoryQuarterlyHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class IncomeStatementHistoryQuarterlyHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Income Statement History Quarterly data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var incomeStatementHistoryQuarterly = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return incomeStatementHistoryQuarterly != null ? (IEnumerable)incomeStatementHistoryQuarterly.QuoteSummary.Results. 16 | Select(x => x.IncomeStatementHistoryQuarterly).First().IncomeStatementHistory : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/IndexTrendHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class IndexTrendHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Index Trend data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var indexTrend = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return indexTrend != null ? (IEnumerable)indexTrend.QuoteSummary.Results.Select(x => x.IndexTrend) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/InsiderHolderHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class InsiderHolderHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Insider Holders Data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var insiderHolderData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return insiderHolderData != null ? (IEnumerable)insiderHolderData.QuoteSummary.Results.Select(x => x.InsiderHolders).First().Holders : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/InsiderTransactionHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class InsiderTransactionHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Insider Transactions Data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var insiderTransactionData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return insiderTransactionData != null ? (IEnumerable)insiderTransactionData.QuoteSummary.Results.Select(x => x.InsiderTransactions).First().Transactions : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/InsightsHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class InsightsHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Insights data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var insights = JsonConvert.DeserializeObject(jsonData); 14 | 15 | if (insights == null || !insights.Finance.Result.Reports.Any()) 16 | { 17 | throw new InvalidOperationException("Requested Information Not Available On Yahoo Finance"); 18 | } 19 | 20 | return new[] { insights.Finance.Result }.Cast(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Helpers/InstitutionHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class InstitutionHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Institution data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var institutionData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return institutionData != null ? (IEnumerable)institutionData.Finance.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/InstitutionOwnershipHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class InstitutionOwnershipHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Institution Ownership data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var institutionOwnership = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return institutionOwnership != null ? (IEnumerable)institutionOwnership.QuoteSummary.Results.Select(x => x.InstitutionOwnership).First().OwnershipList : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/KeyStatisticsHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class KeyStatisticsHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Key Statistics Data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var keyStatisticData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return keyStatisticData != null ? (IEnumerable)keyStatisticData.QuoteSummary.Results.Select(x => x.DefaultKeyStatistics) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/MajorDirectHoldersHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class MajorDirectHoldersHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Major Direct Holders data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var majorDirectHolders = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return majorDirectHolders != null ? (IEnumerable)majorDirectHolders.QuoteSummary.Results.Select(x => x.MajorDirectHolders).First().Holders : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/MajorHoldersBreakdownHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class MajorHoldersBreakdownHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Major Holders Breakdown data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var majorHoldersBreakdown = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return majorHoldersBreakdown != null ? (IEnumerable)majorHoldersBreakdown.QuoteSummary.Results.Select(x => x.MajorHoldersBreakdown) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/MarketSummaryHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class MarketSummaryHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Market Summary data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var marketSummary = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return marketSummary != null ? (IEnumerable)marketSummary.MarketSummaryResponse.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/NetSharePurchaseActivityHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class NetSharePurchaseActivityHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Net Share Purchase Activity data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var netSharePurchaseActivity = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return netSharePurchaseActivity != null ? (IEnumerable)netSharePurchaseActivity.QuoteSummary.Results.Select(x => x.NetSharePurchaseActivity) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/PriceHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class PriceHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Price data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var priceInfo = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return priceInfo != null ? (IEnumerable)priceInfo.QuoteSummary.Results.Select(x => x.Price) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/QuoteTypeHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class QuoteTypeHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Quote Type data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var quoteType = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return quoteType != null ? (IEnumerable)quoteType.QuoteSummary.Results.Select(x => x.QuoteType) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/RealTimeQuoteHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class RealTimeQuoteHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Real-time Quote data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var realTimeQuoteData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return realTimeQuoteData != null ? (IEnumerable)realTimeQuoteData.QuoteResponse.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/RecommendationHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class RecommendationHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Recommendation Data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var rawRecommendData = JsonConvert.DeserializeObject(jsonData); 14 | var rawResults = rawRecommendData?.Finance.Results; 15 | 16 | if (rawResults == null || !rawResults.Any()) 17 | { 18 | throw new InvalidOperationException("Requested Information Not Available On Yahoo Finance"); 19 | } 20 | 21 | return rawRecommendData != null ? (IEnumerable)rawRecommendData.Finance.Results.First().RecommendedSymbols : []; 22 | } 23 | } -------------------------------------------------------------------------------- /src/Helpers/RecommendationTrendHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class RecommendationTrendHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Recommendation Trend data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var recommendationTrend = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return recommendationTrend != null ? (IEnumerable)recommendationTrend.QuoteSummary.Results.Select(x => x.RecommendationTrend).First().Trend : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/ScreenerHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class ScreenerHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Screener data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var screener = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return screener != null ? (IEnumerable)screener.Finance.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/SecFilingsHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | /// 4 | /// Parses the raw json data for the SEC Filings data 5 | /// 6 | internal class SecFilingsHelper : YahooJsonBase 7 | { 8 | internal override IEnumerable ParseYahooJsonData(string jsonData) 9 | { 10 | var secFilings = JsonConvert.DeserializeObject(jsonData); 11 | 12 | return secFilings != null ? (IEnumerable)secFilings.QuoteSummary.Results.Select(x => x.SecFilings).First().Filings : []; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Helpers/SectorTrendHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class SectorTrendHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Sector Trend data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var sectorTrend = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return sectorTrend != null ? (IEnumerable)sectorTrend.QuoteSummary.Results.Select(x => x.SectorTrend) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/SparkChartHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class SparkChartHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Spark Chart data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var root = JObject.Parse(jsonData).Children().FirstOrDefault(); 14 | var result = root?.FirstOrDefault()?.ToObject(); 15 | 16 | return new[] { result }.Cast(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/StockSplitHelper.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 3 | 4 | internal class StockSplitHelper : YahooJsonBase 5 | { 6 | internal override IEnumerable ParseYahooJsonData(string jsonData) 7 | { 8 | var stockSplitData = JsonConvert.DeserializeObject(jsonData); 9 | 10 | if (stockSplitData != null && stockSplitData.Chart?.Result != null) 11 | { 12 | var results = stockSplitData.Chart.Result.Cast(); 13 | 14 | return results; 15 | } 16 | 17 | return []; 18 | } 19 | } -------------------------------------------------------------------------------- /src/Helpers/StocksOwnedHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class StocksOwnedHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Stocks Owned data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var stocksOwned = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return stocksOwned != null ? (IEnumerable)stocksOwned.Finance.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/SummaryDetailsHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class SummaryDetailsHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Summary Details data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var summaryDetailsData = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return summaryDetailsData != null ? (IEnumerable)summaryDetailsData.QuoteSummary.Results.Select(x => x.SummaryDetail) : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/TrendingHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class TrendingHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Trending Data 7 | /// 8 | /// 9 | /// 10 | internal override IEnumerable ParseYahooJsonData(string jsonData) 11 | { 12 | var rawTrendingData = JsonConvert.DeserializeObject(jsonData); 13 | 14 | return rawTrendingData != null ? (IEnumerable)rawTrendingData.Finance.Results.First().Quotes.Select(x => x.Symbol) : []; 15 | } 16 | } -------------------------------------------------------------------------------- /src/Helpers/TrendingStocksHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class TrendingStocksHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Trending Stocks data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var trendingStocks = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return trendingStocks != null ? (IEnumerable)trendingStocks.Finance.Results : []; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Helpers/UpgradeDowngradeHistoryHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Helpers; 2 | 3 | internal class UpgradeDowngradeHistoryHelper : YahooJsonBase 4 | { 5 | /// 6 | /// Parses the raw json data for the Upgrade Downgrade History data 7 | /// 8 | /// 9 | /// 10 | /// 11 | internal override IEnumerable ParseYahooJsonData(string jsonData) 12 | { 13 | var upgradeDowngradeHistory = JsonConvert.DeserializeObject(jsonData); 14 | 15 | return upgradeDowngradeHistory != null ? (IEnumerable)upgradeDowngradeHistory.QuoteSummary.Results. 16 | Select(x => x.UpgradeDowngradeHistory).First().History : []; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Helpers/Usings.cs: -------------------------------------------------------------------------------- 1 | global using OoplesFinance.YahooFinanceAPI.Models; 2 | global using OoplesFinance.YahooFinanceAPI.Enums; 3 | global using OoplesFinance.YahooFinanceAPI.Helpers; 4 | global using System.Globalization; 5 | global using System.Net; 6 | global using static OoplesFinance.YahooFinanceAPI.Helpers.DownloadHelper; 7 | global using static OoplesFinance.YahooFinanceAPI.Helpers.UrlHelper; 8 | global using OoplesFinance.YahooFinanceAPI.Interfaces; 9 | global using Newtonsoft.Json; 10 | global using System.Net.Http; 11 | global using Newtonsoft.Json.Linq; -------------------------------------------------------------------------------- /src/Images/Favicon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooples/OoplesFinance.YahooFinanceAPI/1cff4fe27c120ba4a1a9e6cd5ce1e1d2c6294e0f/src/Images/Favicon.jpg -------------------------------------------------------------------------------- /src/Interfaces/YahooCsvBase.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Interfaces; 2 | 3 | internal abstract class YahooCsvBase 4 | { 5 | internal abstract IEnumerable ParseYahooCsvData(IEnumerable csvData); 6 | } -------------------------------------------------------------------------------- /src/Interfaces/YahooJsonBase.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Interfaces; 2 | 3 | internal abstract class YahooJsonBase 4 | { 5 | internal abstract IEnumerable ParseYahooJsonData(string jsonData); 6 | } -------------------------------------------------------------------------------- /src/IsExternalInit.cs: -------------------------------------------------------------------------------- 1 | namespace System.Runtime.CompilerServices; 2 | 3 | internal static class IsExternalInit {} -------------------------------------------------------------------------------- /src/Models/AnalystData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public record AnalystCriteriaMeta( 4 | [property: JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)] int? Size, 5 | [property: JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] int? Offset, 6 | [property: JsonProperty("sortField", NullValueHandling = NullValueHandling.Ignore)] string SortField, 7 | [property: JsonProperty("sortType", NullValueHandling = NullValueHandling.Ignore)] string SortType, 8 | [property: JsonProperty("entityIdType", NullValueHandling = NullValueHandling.Ignore)] string EntityIdType, 9 | [property: JsonProperty("criteria", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Criteria, 10 | [property: JsonProperty("topOperator", NullValueHandling = NullValueHandling.Ignore)] string TopOperator 11 | ); 12 | 13 | public record AnalystCriterion( 14 | [property: JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)] string Field, 15 | [property: JsonProperty("operators", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Operators, 16 | [property: JsonProperty("values", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Values, 17 | [property: JsonProperty("labelsSelected", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList LabelsSelected, 18 | [property: JsonProperty("dependentValues", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList DependentValues 19 | ); 20 | 21 | public record AnalystFinance( 22 | [property: JsonProperty("result", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Results, 23 | [property: JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)] object Error 24 | ); 25 | 26 | public record AnalystRecord( 27 | [property: JsonProperty("marketCap", NullValueHandling = NullValueHandling.Ignore)] double? MarketCap, 28 | [property: JsonProperty("dayVolume", NullValueHandling = NullValueHandling.Ignore)] long? DayVolume, 29 | [property: JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] double? Price, 30 | [property: JsonProperty("pricePercentChange", NullValueHandling = NullValueHandling.Ignore)] double? PricePercentChange, 31 | [property: JsonProperty("intradayPriceChange", NullValueHandling = NullValueHandling.Ignore)] double? IntradayPriceChange, 32 | [property: JsonProperty("ratingDate", NullValueHandling = NullValueHandling.Ignore)] string RatingDate, 33 | [property: JsonProperty("ratingPrior", NullValueHandling = NullValueHandling.Ignore)] string RatingPrior, 34 | [property: JsonProperty("ratingCurrent", NullValueHandling = NullValueHandling.Ignore)] string RatingCurrent, 35 | [property: JsonProperty("ratingAction", NullValueHandling = NullValueHandling.Ignore)] string RatingAction, 36 | [property: JsonProperty("priceTargetCurrent", NullValueHandling = NullValueHandling.Ignore)] double? PriceTargetCurrent, 37 | [property: JsonProperty("priceTargetAction", NullValueHandling = NullValueHandling.Ignore)] string PriceTargetAction, 38 | [property: JsonProperty("upsideDownsidePercent", NullValueHandling = NullValueHandling.Ignore)] double? UpsideDownsidePercent, 39 | [property: JsonProperty("averageRating", NullValueHandling = NullValueHandling.Ignore)] string AverageRating, 40 | [property: JsonProperty("averagePriceTarget", NullValueHandling = NullValueHandling.Ignore)] double? AveragePriceTarget, 41 | [property: JsonProperty("analystFirm", NullValueHandling = NullValueHandling.Ignore)] string AnalystFirm, 42 | [property: JsonProperty("ticker", NullValueHandling = NullValueHandling.Ignore)] string Ticker, 43 | [property: JsonProperty("companyName", NullValueHandling = NullValueHandling.Ignore)] string CompanyName, 44 | [property: JsonProperty("delayedPrice", NullValueHandling = NullValueHandling.Ignore)] double? DelayedPrice, 45 | [property: JsonProperty("fiftyTwoWeekRange", NullValueHandling = NullValueHandling.Ignore)] string FiftyTwoWeekRange, 46 | [property: JsonProperty("logoUrl", NullValueHandling = NullValueHandling.Ignore)] string LogoUrl, 47 | [property: JsonProperty("priceTargetPrior", NullValueHandling = NullValueHandling.Ignore)] double? PriceTargetPrior 48 | ); 49 | 50 | public record AnalystResult( 51 | [property: JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] string Id, 52 | [property: JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)] string Title, 53 | [property: JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] string Description, 54 | [property: JsonProperty("canonicalName", NullValueHandling = NullValueHandling.Ignore)] string CanonicalName, 55 | [property: JsonProperty("criteriaMeta", NullValueHandling = NullValueHandling.Ignore)] AnalystCriteriaMeta CriteriaMeta, 56 | [property: JsonProperty("rawCriteria", NullValueHandling = NullValueHandling.Ignore)] string RawCriteria, 57 | [property: JsonProperty("start", NullValueHandling = NullValueHandling.Ignore)] int? Start, 58 | [property: JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] int? Count, 59 | [property: JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)] int? Total, 60 | [property: JsonProperty("records", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Records, 61 | [property: JsonProperty("userHasReadRecord", NullValueHandling = NullValueHandling.Ignore)] bool? UserHasReadRecord, 62 | [property: JsonProperty("useRecords", NullValueHandling = NullValueHandling.Ignore)] bool? UseRecords, 63 | [property: JsonProperty("predefinedScr", NullValueHandling = NullValueHandling.Ignore)] bool? PredefinedScr, 64 | [property: JsonProperty("versionId", NullValueHandling = NullValueHandling.Ignore)] int? VersionId, 65 | [property: JsonProperty("isPremium", NullValueHandling = NullValueHandling.Ignore)] bool? IsPremium, 66 | [property: JsonProperty("iconUrl", NullValueHandling = NullValueHandling.Ignore)] string IconUrl 67 | ); 68 | 69 | public record AnalystData( 70 | [property: JsonProperty("finance", NullValueHandling = NullValueHandling.Ignore)] AnalystFinance Finance 71 | ); -------------------------------------------------------------------------------- /src/Models/AssetProfileData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class AssetProfile 4 | { 5 | [JsonProperty("address1")] 6 | public string Address1 { get; set; } = string.Empty; 7 | 8 | [JsonProperty("city")] 9 | public string City { get; set; } = string.Empty; 10 | 11 | [JsonProperty("state")] 12 | public string State { get; set; } = string.Empty; 13 | 14 | [JsonProperty("zip")] 15 | public string Zip { get; set; } = string.Empty; 16 | 17 | [JsonProperty("country")] 18 | public string Country { get; set; } = string.Empty; 19 | 20 | [JsonProperty("phone")] 21 | public string Phone { get; set; } = string.Empty; 22 | 23 | [JsonProperty("website")] 24 | public string Website { get; set; } = string.Empty; 25 | 26 | [JsonProperty("industry")] 27 | public string Industry { get; set; } = string.Empty; 28 | 29 | [JsonProperty("sector")] 30 | public string Sector { get; set; } = string.Empty; 31 | 32 | [JsonProperty("longBusinessSummary")] 33 | public string LongBusinessSummary { get; set; } = string.Empty; 34 | 35 | [JsonProperty("fullTimeEmployees")] 36 | public int? FullTimeEmployees { get; set; } 37 | 38 | [JsonProperty("companyOfficers")] 39 | public List CompanyOfficers { get; set; } = []; 40 | 41 | [JsonProperty("auditRisk")] 42 | public int? AuditRisk { get; set; } 43 | 44 | [JsonProperty("boardRisk")] 45 | public int? BoardRisk { get; set; } 46 | 47 | [JsonProperty("compensationRisk")] 48 | public int? CompensationRisk { get; set; } 49 | 50 | [JsonProperty("shareHolderRightsRisk")] 51 | public int? ShareHolderRightsRisk { get; set; } 52 | 53 | [JsonProperty("overallRisk")] 54 | public int? OverallRisk { get; set; } 55 | 56 | [JsonProperty("governanceEpochDate")] 57 | public int? GovernanceEpochDate { get; set; } 58 | 59 | [JsonProperty("compensationAsOfEpochDate")] 60 | public int? CompensationAsOfEpochDate { get; set; } 61 | 62 | [JsonProperty("maxAge")] 63 | public int? MaxAge { get; set; } 64 | } 65 | 66 | public class CompanyOfficer 67 | { 68 | [JsonProperty("maxAge")] 69 | public int? MaxAge { get; set; } 70 | 71 | [JsonProperty("name")] 72 | public string Name { get; set; } = string.Empty; 73 | 74 | [JsonProperty("age")] 75 | public int? Age { get; set; } 76 | 77 | [JsonProperty("title")] 78 | public string Title { get; set; } = string.Empty; 79 | 80 | [JsonProperty("yearBorn")] 81 | public int? YearBorn { get; set; } 82 | 83 | [JsonProperty("fiscalYear")] 84 | public int? FiscalYear { get; set; } 85 | 86 | [JsonProperty("totalPay")] 87 | public TotalPay TotalPay { get; set; } = new(); 88 | 89 | [JsonProperty("exercisedValue")] 90 | public ExercisedValue ExercisedValue { get; set; } = new(); 91 | 92 | [JsonProperty("unexercisedValue")] 93 | public UnexercisedValue UnexercisedValue { get; set; } = new(); 94 | } 95 | 96 | public class ExercisedValue 97 | { 98 | [JsonProperty("raw")] 99 | public int? Raw { get; set; } 100 | 101 | [JsonProperty("fmt")] 102 | public object Fmt { get; set; } = new(); 103 | 104 | [JsonProperty("longFmt")] 105 | public string LongFmt { get; set; } = string.Empty; 106 | } 107 | 108 | public class AssetProfileQuoteSummary 109 | { 110 | [JsonProperty("result")] 111 | public List Results { get; set; } = []; 112 | 113 | [JsonProperty("error")] 114 | public object Error { get; set; } = new(); 115 | } 116 | 117 | public class AssetProfileResult 118 | { 119 | [JsonProperty("assetProfile")] 120 | public AssetProfile AssetProfile { get; set; } = new(); 121 | } 122 | 123 | public class AssetProfileData 124 | { 125 | [JsonProperty("quoteSummary")] 126 | public AssetProfileQuoteSummary QuoteSummary { get; set; } = new(); 127 | } 128 | 129 | public class TotalPay 130 | { 131 | [JsonProperty("raw")] 132 | public int? Raw { get; set; } 133 | 134 | [JsonProperty("fmt")] 135 | public string Fmt { get; set; } = string.Empty; 136 | 137 | [JsonProperty("longFmt")] 138 | public string LongFmt { get; set; } = string.Empty; 139 | } 140 | 141 | public class UnexercisedValue 142 | { 143 | [JsonProperty("raw")] 144 | public int? Raw { get; set; } 145 | 146 | [JsonProperty("fmt")] 147 | public object Fmt { get; set; } = new(); 148 | 149 | [JsonProperty("longFmt")] 150 | public string LongFmt { get; set; } = string.Empty; 151 | } -------------------------------------------------------------------------------- /src/Models/AutoCompleteData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public record AutoCompleteResult( 4 | [property: JsonProperty("symbol")] string Symbol, 5 | [property: JsonProperty("name")] string Name, 6 | [property: JsonProperty("exch")] string Exch, 7 | [property: JsonProperty("type")] string Type, 8 | [property: JsonProperty("exchDisp")] string ExchDisp, 9 | [property: JsonProperty("typeDisp")] string TypeDisp 10 | ); 11 | 12 | public record ResultSet( 13 | [property: JsonProperty("Query")] string Query, 14 | [property: JsonProperty("Result")] IReadOnlyList Results 15 | ); 16 | 17 | public record AutoCompleteData( 18 | [property: JsonProperty("ResultSet")] ResultSet ResultSet 19 | ); 20 | -------------------------------------------------------------------------------- /src/Models/BalanceSheetHistoryQuarterlyData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class BalanceSheetHistoryQuarterly 4 | { 5 | [JsonProperty("balanceSheetStatements")] 6 | public List BalanceSheetStatements { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class BalanceSheetHistoryQuarterlyQuoteSummary 13 | { 14 | [JsonProperty("result")] 15 | public List Results { get; set; } = []; 16 | 17 | [JsonProperty("error")] 18 | public object Error { get; set; } = new(); 19 | } 20 | 21 | public class BalanceSheetHistoryQuarterlyResult 22 | { 23 | [JsonProperty("balanceSheetHistoryQuarterly")] 24 | public BalanceSheetHistoryQuarterly BalanceSheetHistoryQuarterly { get; set; } = new(); 25 | } 26 | 27 | public class BalanceSheetHistoryQuarterlyData 28 | { 29 | [JsonProperty("quoteSummary")] 30 | public BalanceSheetHistoryQuarterlyQuoteSummary QuoteSummary { get; set; } = new(); 31 | } -------------------------------------------------------------------------------- /src/Models/CalendarEventsData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class CalendarEvents 4 | { 5 | [JsonProperty("maxAge")] 6 | public int? MaxAge { get; set; } 7 | 8 | [JsonProperty("earnings")] 9 | public Earnings Earnings { get; set; } = new(); 10 | 11 | [JsonProperty("exDividendDate")] 12 | public ExDividendDate ExDividendDate { get; set; } = new(); 13 | 14 | [JsonProperty("dividendDate")] 15 | public DividendDate DividendDate { get; set; } = new(); 16 | } 17 | 18 | public class DividendDate 19 | { 20 | [JsonProperty("raw")] 21 | public int? Raw { get; set; } 22 | 23 | [JsonProperty("fmt")] 24 | public string Fmt { get; set; } = string.Empty; 25 | } 26 | 27 | public class Earnings 28 | { 29 | [JsonProperty("earningsDate")] 30 | public List EarningsDate { get; set; } = []; 31 | 32 | [JsonProperty("earningsAverage")] 33 | public EarningsAverage EarningsAverage { get; set; } = new(); 34 | 35 | [JsonProperty("earningsLow")] 36 | public EarningsLow EarningsLow { get; set; } = new(); 37 | 38 | [JsonProperty("earningsHigh")] 39 | public EarningsHigh EarningsHigh { get; set; } = new(); 40 | 41 | [JsonProperty("revenueAverage")] 42 | public RevenueAverage RevenueAverage { get; set; } = new(); 43 | 44 | [JsonProperty("revenueLow")] 45 | public RevenueLow RevenueLow { get; set; } = new(); 46 | 47 | [JsonProperty("revenueHigh")] 48 | public RevenueHigh RevenueHigh { get; set; } = new(); 49 | } 50 | 51 | public class EarningsAverage 52 | { 53 | [JsonProperty("raw")] 54 | public double? Raw { get; set; } 55 | 56 | [JsonProperty("fmt")] 57 | public string Fmt { get; set; } = string.Empty; 58 | } 59 | 60 | public class EarningsDate 61 | { 62 | [JsonProperty("raw")] 63 | public int? Raw { get; set; } 64 | 65 | [JsonProperty("fmt")] 66 | public string Fmt { get; set; } = string.Empty; 67 | } 68 | 69 | public class EarningsHigh 70 | { 71 | [JsonProperty("raw")] 72 | public double? Raw { get; set; } 73 | 74 | [JsonProperty("fmt")] 75 | public string Fmt { get; set; } = string.Empty; 76 | } 77 | 78 | public class EarningsLow 79 | { 80 | [JsonProperty("raw")] 81 | public double? Raw { get; set; } 82 | 83 | [JsonProperty("fmt")] 84 | public string Fmt { get; set; } = string.Empty; 85 | } 86 | 87 | public class CalendarEventsQuoteSummary 88 | { 89 | [JsonProperty("result")] 90 | public List Results { get; set; } = []; 91 | 92 | [JsonProperty("error")] 93 | public object Error { get; set; } = new(); 94 | } 95 | 96 | public class CalendarEventsResult 97 | { 98 | [JsonProperty("calendarEvents")] 99 | public CalendarEvents CalendarEvents { get; set; } = new(); 100 | } 101 | 102 | public class RevenueAverage 103 | { 104 | [JsonProperty("raw")] 105 | public long? Raw { get; set; } 106 | 107 | [JsonProperty("fmt")] 108 | public string Fmt { get; set; } = string.Empty; 109 | 110 | [JsonProperty("longFmt")] 111 | public string LongFmt { get; set; } = string.Empty; 112 | } 113 | 114 | public class RevenueHigh 115 | { 116 | [JsonProperty("raw")] 117 | public long? Raw { get; set; } 118 | 119 | [JsonProperty("fmt")] 120 | public string Fmt { get; set; } = string.Empty; 121 | 122 | [JsonProperty("longFmt")] 123 | public string LongFmt { get; set; } = string.Empty; 124 | } 125 | 126 | public class RevenueLow 127 | { 128 | [JsonProperty("raw")] 129 | public long? Raw { get; set; } 130 | 131 | [JsonProperty("fmt")] 132 | public string Fmt { get; set; } = string.Empty; 133 | 134 | [JsonProperty("longFmt")] 135 | public string LongFmt { get; set; } = string.Empty; 136 | } 137 | 138 | public class CalendarEventsData 139 | { 140 | [JsonProperty("quoteSummary")] 141 | public CalendarEventsQuoteSummary QuoteSummary { get; set; } = new(); 142 | } -------------------------------------------------------------------------------- /src/Models/CapitalGainData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | [Serializable] 4 | public class CapitalGainDataRoot 5 | { 6 | [JsonProperty("chart")] 7 | public Chart? Chart { get; set; } 8 | } -------------------------------------------------------------------------------- /src/Models/CashflowStatementHistoryQuarterlyData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class CashflowStatementHistoryQuarterly 4 | { 5 | [JsonProperty("cashflowStatements")] 6 | public List CashflowStatements { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class CashflowStatementHistoryQuarterlyQuoteSummary 13 | { 14 | [JsonProperty("result")] 15 | public List Results { get; set; } = []; 16 | 17 | [JsonProperty("error")] 18 | public object Error { get; set; } = new(); 19 | } 20 | 21 | public class CashflowStatementHistoryQuarterlyResult 22 | { 23 | [JsonProperty("cashflowStatementHistoryQuarterly")] 24 | public CashflowStatementHistoryQuarterly CashflowStatementHistoryQuarterly { get; set; } = new(); 25 | } 26 | 27 | public class CashflowStatementHistoryQuarterlyData 28 | { 29 | [JsonProperty("quoteSummary")] 30 | public CashflowStatementHistoryQuarterlyQuoteSummary QuoteSummary { get; set; } = new(); 31 | } -------------------------------------------------------------------------------- /src/Models/ChartData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class ChartData 4 | { 5 | [JsonProperty("result")] 6 | public List Result { get; set; } = []; 7 | 8 | [JsonProperty("error")] 9 | public object Error { get; set; } = new(); 10 | } 11 | 12 | public class TradingPeriod 13 | { 14 | [JsonProperty("timezone")] 15 | public string Timezone { get; set; } = string.Empty; 16 | 17 | [JsonProperty("end")] 18 | public int? End { get; set; } 19 | 20 | [JsonProperty("start")] 21 | public int? Start { get; set; } 22 | 23 | [JsonProperty("gmtoffset")] 24 | public int? Gmtoffset { get; set; } 25 | } 26 | 27 | public class ChartQuote 28 | { 29 | [JsonProperty("open")] 30 | public List Open { get; set; } = []; 31 | 32 | [JsonProperty("low")] 33 | public List Low { get; set; } = []; 34 | 35 | [JsonProperty("volume")] 36 | public List Volume { get; set; } = []; 37 | 38 | [JsonProperty("close")] 39 | public List Close { get; set; } = []; 40 | 41 | [JsonProperty("high")] 42 | public List High { get; set; } = []; 43 | } 44 | 45 | public class ChartResult 46 | { 47 | [JsonProperty("meta")] 48 | public Meta? Meta { get; set; } 49 | 50 | [JsonProperty("timestamp")] 51 | public List Timestamp { get; set; } = []; 52 | 53 | [JsonProperty("indicators")] 54 | public Indicators? Indicators { get; set; } 55 | } 56 | 57 | public class ChartRoot 58 | { 59 | [JsonProperty("chart")] 60 | public ChartData Chart { get; set; } = new(); 61 | } 62 | 63 | public class ChartInfo 64 | { 65 | public List DateList { get; set; } = []; 66 | 67 | public List OpenList { get; set; } = []; 68 | 69 | public List HighList { get; set; } = []; 70 | 71 | public List LowList { get; set; } = []; 72 | 73 | public List CloseList { get; set; } = []; 74 | 75 | public List VolumeList { get; set; } = []; 76 | } -------------------------------------------------------------------------------- /src/Models/DividendData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | [Serializable] 4 | public class AdjClose 5 | { 6 | [JsonProperty("adjclose")] 7 | public List Adjclose { get; set; } = []; 8 | } 9 | 10 | public class DividendChart 11 | { 12 | [JsonProperty("result")] 13 | public List Result { get; set; } = []; 14 | 15 | [JsonProperty("error")] 16 | public object Error { get; set; } = new(); 17 | } 18 | 19 | public class CurrentTradingPeriod 20 | { 21 | [JsonProperty("pre")] 22 | public Pre Pre { get; set; } = new(); 23 | 24 | [JsonProperty("regular")] 25 | public Regular Regular { get; set; } = new(); 26 | 27 | [JsonProperty("post")] 28 | public Post Post { get; set; } = new(); 29 | } 30 | 31 | public class Dividends 32 | { 33 | [JsonProperty("amount")] 34 | public double? Amount { get; set; } 35 | 36 | [JsonProperty("date")] 37 | public int? Date { get; set; } 38 | } 39 | 40 | public class DividendEvents 41 | { 42 | [JsonProperty("dividends")] 43 | public Dictionary DividendData { get; set; } = []; 44 | } 45 | 46 | public class Indicators 47 | { 48 | [JsonProperty("quote")] 49 | public List Quote { get; set; } = []; 50 | 51 | [JsonProperty("adjclose")] 52 | public List Adjclose { get; set; } = []; 53 | } 54 | 55 | public class Meta 56 | { 57 | [JsonProperty("currency")] 58 | public string Currency { get; set; } = string.Empty; 59 | 60 | [JsonProperty("symbol")] 61 | public string Symbol { get; set; } = string.Empty; 62 | 63 | [JsonProperty("exchangeName")] 64 | public string ExchangeName { get; set; } = string.Empty; 65 | 66 | [JsonProperty("fullExchangeName")] 67 | public string FullExchangeName { get; set; } = string.Empty; 68 | 69 | [JsonProperty("instrumentType")] 70 | public string InstrumentType { get; set; } = string.Empty; 71 | 72 | [JsonProperty("firstTradeDate")] 73 | public int? FirstTradeDate { get; set; } 74 | 75 | [JsonProperty("regularMarketTime")] 76 | public int? RegularMarketTime { get; set; } 77 | 78 | [JsonProperty("hasPrePostMarketData")] 79 | public bool? HasPrePostMarketData { get; set; } 80 | 81 | [JsonProperty("gmtoffset")] 82 | public int? Gmtoffset { get; set; } 83 | 84 | [JsonProperty("timezone")] 85 | public string Timezone { get; set; } = string.Empty; 86 | 87 | [JsonProperty("exchangeTimezoneName")] 88 | public string ExchangeTimezoneName { get; set; } = string.Empty; 89 | 90 | [JsonProperty("regularMarketPrice")] 91 | public double? RegularMarketPrice { get; set; } 92 | 93 | [JsonProperty("fiftyTwoWeekHigh")] 94 | public double? FiftyTwoWeekHigh { get; set; } 95 | 96 | [JsonProperty("fiftyTwoWeekLow")] 97 | public double? FiftyTwoWeekLow { get; set; } 98 | 99 | [JsonProperty("regularMarketDayHigh")] 100 | public double? RegularMarketDayHigh { get; set; } 101 | 102 | [JsonProperty("regularMarketDayLow")] 103 | public double? RegularMarketDayLow { get; set; } 104 | 105 | [JsonProperty("regularMarketVolume")] 106 | public long? RegularMarketVolume { get; set; } 107 | 108 | [JsonProperty("longName")] 109 | public string LongName { get; set; } = string.Empty; 110 | 111 | [JsonProperty("shortName")] 112 | public string ShortName { get; set; } = string.Empty; 113 | 114 | [JsonProperty("chartPreviousClose")] 115 | public double? ChartPreviousClose { get; set; } 116 | 117 | [JsonProperty("priceHint")] 118 | public int? PriceHint { get; set; } 119 | 120 | [JsonProperty("currentTradingPeriod")] 121 | public CurrentTradingPeriod CurrentTradingPeriod { get; set; } = new(); 122 | 123 | [JsonProperty("dataGranularity")] 124 | public string DataGranularity { get; set; } = string.Empty; 125 | 126 | [JsonProperty("range")] 127 | public string Range { get; set; } = string.Empty; 128 | 129 | [JsonProperty("validRanges")] 130 | public List ValidRanges { get; set; } = []; 131 | } 132 | 133 | public class Post 134 | { 135 | [JsonProperty("timezone")] 136 | public string Timezone { get; set; } = string.Empty; 137 | 138 | [JsonProperty("start")] 139 | public int? Start { get; set; } 140 | 141 | [JsonProperty("end")] 142 | public int? End { get; set; } 143 | 144 | [JsonProperty("gmtoffset")] 145 | public int? Gmtoffset { get; set; } 146 | } 147 | 148 | public class Pre 149 | { 150 | [JsonProperty("timezone")] 151 | public string Timezone { get; set; } = string.Empty; 152 | 153 | [JsonProperty("start")] 154 | public int? Start { get; set; } 155 | 156 | [JsonProperty("end")] 157 | public int? End { get; set; } 158 | 159 | [JsonProperty("gmtoffset")] 160 | public int? Gmtoffset { get; set; } 161 | } 162 | 163 | public class Quote 164 | { 165 | [JsonProperty("close")] 166 | public List Close { get; set; } = []; 167 | 168 | [JsonProperty("high")] 169 | public List High { get; set; } = []; 170 | 171 | [JsonProperty("low")] 172 | public List Low { get; set; } = []; 173 | 174 | [JsonProperty("volume")] 175 | public List Volume { get; set; } = []; 176 | 177 | [JsonProperty("open")] 178 | public List Open { get; set; } = []; 179 | } 180 | 181 | public class Regular 182 | { 183 | [JsonProperty("timezone")] 184 | public string Timezone { get; set; } = string.Empty; 185 | 186 | [JsonProperty("start")] 187 | public int? Start { get; set; } 188 | 189 | [JsonProperty("end")] 190 | public int? End { get; set; } 191 | 192 | [JsonProperty("gmtoffset")] 193 | public int? Gmtoffset { get; set; } 194 | } 195 | 196 | public class DividendResult 197 | { 198 | [JsonProperty("meta")] 199 | public Meta Meta { get; set; } = new(); 200 | 201 | [JsonProperty("timestamp")] 202 | public List Timestamp { get; set; } = []; 203 | 204 | [JsonProperty("events")] 205 | public DividendEvents Events { get; set; } = new(); 206 | 207 | [JsonProperty("indicators")] 208 | public Indicators Indicators { get; set; } = new(); 209 | } 210 | 211 | public class DividendRoot 212 | { 213 | [JsonProperty("chart")] 214 | public DividendChart Chart { get; set; } = new(); 215 | } 216 | 217 | public partial class DividendItem 218 | { 219 | public long Name {get; set;} 220 | public Dividends DividendDataObject { get; set; } = new(); 221 | } -------------------------------------------------------------------------------- /src/Models/EarningsData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class Actual 4 | { 5 | [JsonProperty("raw")] 6 | public double? Raw { get; set; } 7 | 8 | [JsonProperty("fmt")] 9 | public string Fmt { get; set; } = string.Empty; 10 | } 11 | 12 | public class CurrentQuarterEstimate 13 | { 14 | [JsonProperty("raw")] 15 | public double? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | } 20 | 21 | public class EarningsInfo 22 | { 23 | [JsonProperty("maxAge")] 24 | public int? MaxAge { get; set; } 25 | 26 | [JsonProperty("earningsChart")] 27 | public EarningsChart EarningsChart { get; set; } = new(); 28 | 29 | [JsonProperty("financialsChart")] 30 | public FinancialsChart FinancialsChart { get; set; } = new(); 31 | 32 | [JsonProperty("financialCurrency")] 33 | public string FinancialCurrency { get; set; } = string.Empty; 34 | 35 | [JsonProperty("raw")] 36 | public object Raw { get; set; } = new(); 37 | 38 | [JsonProperty("fmt")] 39 | public string Fmt { get; set; } = string.Empty; 40 | 41 | [JsonProperty("longFmt")] 42 | public string LongFmt { get; set; } = string.Empty; 43 | } 44 | 45 | public class EarningsChart 46 | { 47 | [JsonProperty("quarterly")] 48 | public List Quarterly { get; set; } = []; 49 | 50 | [JsonProperty("currentQuarterEstimate")] 51 | public CurrentQuarterEstimate CurrentQuarterEstimate { get; set; } = new(); 52 | 53 | [JsonProperty("currentQuarterEstimateDate")] 54 | public string CurrentQuarterEstimateDate { get; set; } = string.Empty; 55 | 56 | [JsonProperty("currentQuarterEstimateYear")] 57 | public int? CurrentQuarterEstimateYear { get; set; } 58 | 59 | [JsonProperty("earningsDate")] 60 | public List EarningsDate { get; set; } = []; 61 | } 62 | 63 | public class EarningsEstimateInfo 64 | { 65 | [JsonProperty("raw")] 66 | public double? Raw { get; set; } 67 | 68 | [JsonProperty("fmt")] 69 | public string Fmt { get; set; } = string.Empty; 70 | } 71 | 72 | public class FinancialsChart 73 | { 74 | [JsonProperty("yearly")] 75 | public List Yearly { get; set; } = []; 76 | 77 | [JsonProperty("quarterly")] 78 | public List Quarterly { get; set; } = []; 79 | } 80 | 81 | public class Quarterly 82 | { 83 | [JsonProperty("date")] 84 | public string Date { get; set; } = string.Empty; 85 | 86 | [JsonProperty("actual")] 87 | public Actual Actual { get; set; } = new(); 88 | 89 | [JsonProperty("estimate")] 90 | public EarningsEstimateInfo Estimate { get; set; } = new(); 91 | 92 | [JsonProperty("revenue")] 93 | public Revenue Revenue { get; set; } = new(); 94 | 95 | [JsonProperty("earnings")] 96 | public EarningsInfo Earnings { get; set; } = new(); 97 | } 98 | 99 | public class EarningsQuoteSummary 100 | { 101 | [JsonProperty("result")] 102 | public List Results { get; set; } = []; 103 | 104 | [JsonProperty("error")] 105 | public object Error { get; set; } = new(); 106 | } 107 | 108 | public class EarningsResult 109 | { 110 | [JsonProperty("earnings")] 111 | public EarningsInfo Earnings { get; set; } = new(); 112 | } 113 | 114 | public class Revenue 115 | { 116 | [JsonProperty("raw")] 117 | public object Raw { get; set; } = new(); 118 | 119 | [JsonProperty("fmt")] 120 | public string Fmt { get; set; } = string.Empty; 121 | 122 | [JsonProperty("longFmt")] 123 | public string LongFmt { get; set; } = string.Empty; 124 | } 125 | 126 | public class EarningsData 127 | { 128 | [JsonProperty("quoteSummary")] 129 | public EarningsQuoteSummary QuoteSummary { get; set; } = new(); 130 | } 131 | 132 | public class Yearly 133 | { 134 | [JsonProperty("date")] 135 | public int? Date { get; set; } 136 | 137 | [JsonProperty("revenue")] 138 | public Revenue Revenue { get; set; } = new(); 139 | 140 | [JsonProperty("earnings")] 141 | public EarningsInfo Earnings { get; set; } = new(); 142 | } -------------------------------------------------------------------------------- /src/Models/EarningsHistoryData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class EarningsHistory 4 | { 5 | [JsonProperty("history")] 6 | public List History { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class EpsActual 13 | { 14 | [JsonProperty("raw")] 15 | public double? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | } 20 | 21 | public class EpsDifference 22 | { 23 | [JsonProperty("raw")] 24 | public double? Raw { get; set; } 25 | 26 | [JsonProperty("fmt")] 27 | public string Fmt { get; set; } = string.Empty; 28 | } 29 | 30 | public class EpsEstimate 31 | { 32 | [JsonProperty("raw")] 33 | public double? Raw { get; set; } 34 | 35 | [JsonProperty("fmt")] 36 | public string Fmt { get; set; } = string.Empty; 37 | } 38 | 39 | public class EarningsHistoryInfo 40 | { 41 | [JsonProperty("maxAge")] 42 | public int? MaxAge { get; set; } 43 | 44 | [JsonProperty("epsActual")] 45 | public EpsActual EpsActual { get; set; } = new(); 46 | 47 | [JsonProperty("epsEstimate")] 48 | public EpsEstimate EpsEstimate { get; set; } = new(); 49 | 50 | [JsonProperty("epsDifference")] 51 | public EpsDifference EpsDifference { get; set; } = new(); 52 | 53 | [JsonProperty("surprisePercent")] 54 | public SurprisePercent SurprisePercent { get; set; } = new(); 55 | 56 | [JsonProperty("quarter")] 57 | public Quarter Quarter { get; set; } = new(); 58 | 59 | [JsonProperty("period")] 60 | public string Period { get; set; } = string.Empty; 61 | } 62 | 63 | public class Quarter 64 | { 65 | [JsonProperty("raw")] 66 | public int? Raw { get; set; } 67 | 68 | [JsonProperty("fmt")] 69 | public string Fmt { get; set; } = string.Empty; 70 | } 71 | 72 | public class EarningsHistoryQuoteSummary 73 | { 74 | [JsonProperty("result")] 75 | public List Results { get; set; } = []; 76 | 77 | [JsonProperty("error")] 78 | public object Error { get; set; } = new(); 79 | } 80 | 81 | public class EarningsHistoryResult 82 | { 83 | [JsonProperty("earningsHistory")] 84 | public EarningsHistory EarningsHistory { get; set; } = new(); 85 | } 86 | 87 | public class EarningsHistoryData 88 | { 89 | [JsonProperty("quoteSummary")] 90 | public EarningsHistoryQuoteSummary QuoteSummary { get; set; } = new(); 91 | } 92 | 93 | public class SurprisePercent 94 | { 95 | [JsonProperty("raw")] 96 | public double? Raw { get; set; } 97 | 98 | [JsonProperty("fmt")] 99 | public string Fmt { get; set; } = string.Empty; 100 | } -------------------------------------------------------------------------------- /src/Models/EarningsTrendData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class _30daysAgo 4 | { 5 | [JsonProperty("raw")] 6 | public double? Raw { get; set; } 7 | 8 | [JsonProperty("fmt")] 9 | public string Fmt { get; set; } = string.Empty; 10 | } 11 | 12 | public class _60daysAgo 13 | { 14 | [JsonProperty("raw")] 15 | public double? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | } 20 | 21 | public class _7daysAgo 22 | { 23 | [JsonProperty("raw")] 24 | public double? Raw { get; set; } 25 | 26 | [JsonProperty("fmt")] 27 | public string Fmt { get; set; } = string.Empty; 28 | } 29 | 30 | public class _90daysAgo 31 | { 32 | [JsonProperty("raw")] 33 | public double? Raw { get; set; } 34 | 35 | [JsonProperty("fmt")] 36 | public string Fmt { get; set; } = string.Empty; 37 | } 38 | 39 | public class Avg 40 | { 41 | [JsonProperty("raw")] 42 | public double? Raw { get; set; } 43 | 44 | [JsonProperty("fmt")] 45 | public string Fmt { get; set; } = string.Empty; 46 | 47 | [JsonProperty("longFmt")] 48 | public string LongFmt { get; set; } = string.Empty; 49 | } 50 | 51 | public class Current 52 | { 53 | [JsonProperty("raw")] 54 | public double? Raw { get; set; } 55 | 56 | [JsonProperty("fmt")] 57 | public string Fmt { get; set; } = string.Empty; 58 | } 59 | 60 | public class DownLast30days 61 | { 62 | [JsonProperty("raw")] 63 | public int? Raw { get; set; } 64 | 65 | [JsonProperty("fmt")] 66 | public string Fmt { get; set; } = string.Empty; 67 | 68 | [JsonProperty("longFmt")] 69 | public string LongFmt { get; set; } = string.Empty; 70 | } 71 | 72 | public class DownLast90days 73 | { 74 | [JsonProperty("raw")] 75 | public int? Raw { get; set; } 76 | 77 | [JsonProperty("fmt")] 78 | public string Fmt { get; set; } = string.Empty; 79 | 80 | [JsonProperty("longFmt")] 81 | public string LongFmt { get; set; } = string.Empty; 82 | } 83 | 84 | public class EarningsEstimate 85 | { 86 | [JsonProperty("avg")] 87 | public Avg Avg { get; set; } = new(); 88 | 89 | [JsonProperty("low")] 90 | public Low Low { get; set; } = new(); 91 | 92 | [JsonProperty("high")] 93 | public High High { get; set; } = new(); 94 | 95 | [JsonProperty("yearAgoEps")] 96 | public YearAgoEps YearAgoEps { get; set; } = new(); 97 | 98 | [JsonProperty("numberOfAnalysts")] 99 | public NumberOfAnalysts NumberOfAnalysts { get; set; } = new(); 100 | 101 | [JsonProperty("growth")] 102 | public Growth Growth { get; set; } = new(); 103 | } 104 | 105 | public class EarningsTrend 106 | { 107 | [JsonProperty("trend")] 108 | public List Trends { get; set; } = []; 109 | 110 | [JsonProperty("maxAge")] 111 | public int? MaxAge { get; set; } 112 | } 113 | 114 | public class EpsRevisions 115 | { 116 | [JsonProperty("upLast7days")] 117 | public UpLast7days UpLast7days { get; set; } = new(); 118 | 119 | [JsonProperty("upLast30days")] 120 | public UpLast30days UpLast30days { get; set; } = new(); 121 | 122 | [JsonProperty("downLast30days")] 123 | public DownLast30days DownLast30days { get; set; } = new(); 124 | 125 | [JsonProperty("downLast90days")] 126 | public DownLast90days DownLast90days { get; set; } = new(); 127 | } 128 | 129 | public class EpsTrend 130 | { 131 | [JsonProperty("current")] 132 | public Current Current { get; set; } = new(); 133 | 134 | [JsonProperty("7daysAgo")] 135 | public _7daysAgo _7daysAgo { get; set; } = new(); 136 | 137 | [JsonProperty("30daysAgo")] 138 | public _30daysAgo _30daysAgo { get; set; } = new(); 139 | 140 | [JsonProperty("60daysAgo")] 141 | public _60daysAgo _60daysAgo { get; set; } = new(); 142 | 143 | [JsonProperty("90daysAgo")] 144 | public _90daysAgo _90daysAgo { get; set; } = new(); 145 | } 146 | 147 | public class High 148 | { 149 | [JsonProperty("raw")] 150 | public double? Raw { get; set; } 151 | 152 | [JsonProperty("fmt")] 153 | public string Fmt { get; set; } = string.Empty; 154 | 155 | [JsonProperty("longFmt")] 156 | public string LongFmt { get; set; } = string.Empty; 157 | } 158 | 159 | public class Low 160 | { 161 | [JsonProperty("raw")] 162 | public double? Raw { get; set; } 163 | 164 | [JsonProperty("fmt")] 165 | public string Fmt { get; set; } = string.Empty; 166 | 167 | [JsonProperty("longFmt")] 168 | public string LongFmt { get; set; } = string.Empty; 169 | } 170 | 171 | public class NumberOfAnalysts 172 | { 173 | [JsonProperty("raw")] 174 | public int? Raw { get; set; } 175 | 176 | [JsonProperty("fmt")] 177 | public string Fmt { get; set; } = string.Empty; 178 | 179 | [JsonProperty("longFmt")] 180 | public string LongFmt { get; set; } = string.Empty; 181 | } 182 | 183 | public class EarningsTrendQuoteSummary 184 | { 185 | [JsonProperty("result")] 186 | public List Results { get; set; } = []; 187 | 188 | [JsonProperty("error")] 189 | public object Error { get; set; } = new(); 190 | } 191 | 192 | public class EarningsTrendResult 193 | { 194 | [JsonProperty("earningsTrend")] 195 | public EarningsTrend EarningsTrend { get; set; } = new(); 196 | } 197 | 198 | public class RevenueEstimate 199 | { 200 | [JsonProperty("avg")] 201 | public Avg Avg { get; set; } = new(); 202 | 203 | [JsonProperty("low")] 204 | public Low Low { get; set; } = new(); 205 | 206 | [JsonProperty("high")] 207 | public High High { get; set; } = new(); 208 | 209 | [JsonProperty("numberOfAnalysts")] 210 | public NumberOfAnalysts NumberOfAnalysts { get; set; } = new(); 211 | 212 | [JsonProperty("yearAgoRevenue")] 213 | public YearAgoRevenue YearAgoRevenue { get; set; } = new(); 214 | 215 | [JsonProperty("growth")] 216 | public Growth Growth { get; set; } = new(); 217 | } 218 | 219 | public class EarningsTrendData 220 | { 221 | [JsonProperty("quoteSummary")] 222 | public EarningsTrendQuoteSummary QuoteSummary { get; set; } = new(); 223 | } 224 | 225 | public class EarningsTrendInfo 226 | { 227 | [JsonProperty("maxAge")] 228 | public int? MaxAge { get; set; } 229 | 230 | [JsonProperty("period")] 231 | public string Period { get; set; } = string.Empty; 232 | 233 | [JsonProperty("endDate")] 234 | public string EndDate { get; set; } = string.Empty; 235 | 236 | [JsonProperty("growth")] 237 | public Growth Growth { get; set; } = new(); 238 | 239 | [JsonProperty("earningsEstimate")] 240 | public EarningsEstimate EarningsEstimate { get; set; } = new(); 241 | 242 | [JsonProperty("revenueEstimate")] 243 | public RevenueEstimate RevenueEstimate { get; set; } = new(); 244 | 245 | [JsonProperty("epsTrend")] 246 | public EpsTrend EpsTrend { get; set; } = new(); 247 | 248 | [JsonProperty("epsRevisions")] 249 | public EpsRevisions EpsRevisions { get; set; } = new(); 250 | } 251 | 252 | public class UpLast30days 253 | { 254 | [JsonProperty("raw")] 255 | public int? Raw { get; set; } 256 | 257 | [JsonProperty("fmt")] 258 | public string Fmt { get; set; } = string.Empty; 259 | 260 | [JsonProperty("longFmt")] 261 | public string LongFmt { get; set; } = string.Empty; 262 | } 263 | 264 | public class UpLast7days 265 | { 266 | [JsonProperty("raw")] 267 | public int? Raw { get; set; } 268 | 269 | [JsonProperty("fmt")] 270 | public string Fmt { get; set; } = string.Empty; 271 | 272 | [JsonProperty("longFmt")] 273 | public string LongFmt { get; set; } = string.Empty; 274 | } 275 | 276 | public class YearAgoEps 277 | { 278 | [JsonProperty("raw")] 279 | public double? Raw { get; set; } 280 | 281 | [JsonProperty("fmt")] 282 | public string Fmt { get; set; } = string.Empty; 283 | } 284 | 285 | public class YearAgoRevenue 286 | { 287 | [JsonProperty("raw")] 288 | public long? Raw { get; set; } 289 | 290 | [JsonProperty("fmt")] 291 | public string Fmt { get; set; } = string.Empty; 292 | 293 | [JsonProperty("longFmt")] 294 | public string LongFmt { get; set; } = string.Empty; 295 | } -------------------------------------------------------------------------------- /src/Models/EsgScoresData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class EnvironmentPercentile 4 | { 5 | [JsonProperty("raw")] 6 | public double? Raw { get; set; } 7 | 8 | [JsonProperty("fmt")] 9 | public string Fmt { get; set; } = string.Empty; 10 | } 11 | 12 | public class EnvironmentScore 13 | { 14 | [JsonProperty("raw")] 15 | public double? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | } 20 | 21 | public class EsgScores 22 | { 23 | [JsonProperty("maxAge")] 24 | public int? MaxAge { get; set; } 25 | 26 | [JsonProperty("totalEsg")] 27 | public TotalEsg TotalEsg { get; set; } = new(); 28 | 29 | [JsonProperty("environmentScore")] 30 | public EnvironmentScore EnvironmentScore { get; set; } = new(); 31 | 32 | [JsonProperty("socialScore")] 33 | public SocialScore SocialScore { get; set; } = new(); 34 | 35 | [JsonProperty("governanceScore")] 36 | public GovernanceScore GovernanceScore { get; set; } = new(); 37 | 38 | [JsonProperty("ratingYear")] 39 | public int? RatingYear { get; set; } 40 | 41 | [JsonProperty("ratingMonth")] 42 | public int? RatingMonth { get; set; } 43 | 44 | [JsonProperty("highestControversy")] 45 | public double? HighestControversy { get; set; } 46 | 47 | [JsonProperty("esgPerformance")] 48 | public string EsgPerformance { get; set; } = string.Empty; 49 | 50 | [JsonProperty("peerCount")] 51 | public int? PeerCount { get; set; } 52 | 53 | [JsonProperty("peerGroup")] 54 | public string PeerGroup { get; set; } = string.Empty; 55 | 56 | [JsonProperty("relatedControversy")] 57 | public List RelatedControversy { get; set; } = []; 58 | 59 | [JsonProperty("peerEsgScorePerformance")] 60 | public PeerEsgScorePerformance PeerEsgScorePerformance { get; set; } = new(); 61 | 62 | [JsonProperty("peerGovernancePerformance")] 63 | public PeerGovernancePerformance PeerGovernancePerformance { get; set; } = new(); 64 | 65 | [JsonProperty("peerSocialPerformance")] 66 | public PeerSocialPerformance PeerSocialPerformance { get; set; } = new(); 67 | 68 | [JsonProperty("peerEnvironmentPerformance")] 69 | public PeerEnvironmentPerformance PeerEnvironmentPerformance { get; set; } = new(); 70 | 71 | [JsonProperty("peerHighestControversyPerformance")] 72 | public PeerHighestControversyPerformance PeerHighestControversyPerformance { get; set; } = new(); 73 | 74 | [JsonProperty("percentile")] 75 | public Percentile Percentile { get; set; } = new(); 76 | 77 | [JsonProperty("environmentPercentile")] 78 | public EnvironmentPercentile EnvironmentPercentile { get; set; } = new(); 79 | 80 | [JsonProperty("socialPercentile")] 81 | public SocialPercentile SocialPercentile { get; set; } = new(); 82 | 83 | [JsonProperty("governancePercentile")] 84 | public GovernancePercentile GovernancePercentile { get; set; } = new(); 85 | 86 | [JsonProperty("adult")] 87 | public bool? Adult { get; set; } 88 | 89 | [JsonProperty("alcoholic")] 90 | public bool? Alcoholic { get; set; } 91 | 92 | [JsonProperty("animalTesting")] 93 | public bool? AnimalTesting { get; set; } 94 | 95 | [JsonProperty("catholic")] 96 | public bool? Catholic { get; set; } 97 | 98 | [JsonProperty("controversialWeapons")] 99 | public bool? ControversialWeapons { get; set; } 100 | 101 | [JsonProperty("smallArms")] 102 | public bool? SmallArms { get; set; } 103 | 104 | [JsonProperty("furLeather")] 105 | public bool? FurLeather { get; set; } 106 | 107 | [JsonProperty("gambling")] 108 | public bool? Gambling { get; set; } 109 | 110 | [JsonProperty("gmo")] 111 | public bool? Gmo { get; set; } 112 | 113 | [JsonProperty("militaryContract")] 114 | public bool? MilitaryContract { get; set; } 115 | 116 | [JsonProperty("nuclear")] 117 | public bool? Nuclear { get; set; } 118 | 119 | [JsonProperty("pesticides")] 120 | public bool? Pesticides { get; set; } 121 | 122 | [JsonProperty("palmOil")] 123 | public bool? PalmOil { get; set; } 124 | 125 | [JsonProperty("coal")] 126 | public bool? Coal { get; set; } 127 | 128 | [JsonProperty("tobacco")] 129 | public bool? Tobacco { get; set; } 130 | } 131 | 132 | public class GovernancePercentile 133 | { 134 | [JsonProperty("raw")] 135 | public double? Raw { get; set; } 136 | 137 | [JsonProperty("fmt")] 138 | public string Fmt { get; set; } = string.Empty; 139 | } 140 | 141 | public class GovernanceScore 142 | { 143 | [JsonProperty("raw")] 144 | public double? Raw { get; set; } 145 | 146 | [JsonProperty("fmt")] 147 | public string Fmt { get; set; } = string.Empty; 148 | } 149 | 150 | public class PeerEnvironmentPerformance 151 | { 152 | [JsonProperty("min")] 153 | public double? Min { get; set; } 154 | 155 | [JsonProperty("avg")] 156 | public double? Avg { get; set; } 157 | 158 | [JsonProperty("max")] 159 | public double? Max { get; set; } 160 | } 161 | 162 | public class PeerEsgScorePerformance 163 | { 164 | [JsonProperty("min")] 165 | public double? Min { get; set; } 166 | 167 | [JsonProperty("avg")] 168 | public double? Avg { get; set; } 169 | 170 | [JsonProperty("max")] 171 | public double? Max { get; set; } 172 | } 173 | 174 | public class PeerGovernancePerformance 175 | { 176 | [JsonProperty("min")] 177 | public double? Min { get; set; } 178 | 179 | [JsonProperty("avg")] 180 | public double? Avg { get; set; } 181 | 182 | [JsonProperty("max")] 183 | public double? Max { get; set; } 184 | } 185 | 186 | public class PeerHighestControversyPerformance 187 | { 188 | [JsonProperty("min")] 189 | public double? Min { get; set; } 190 | 191 | [JsonProperty("avg")] 192 | public double? Avg { get; set; } 193 | 194 | [JsonProperty("max")] 195 | public double? Max { get; set; } 196 | } 197 | 198 | public class PeerSocialPerformance 199 | { 200 | [JsonProperty("min")] 201 | public double? Min { get; set; } 202 | 203 | [JsonProperty("avg")] 204 | public double? Avg { get; set; } 205 | 206 | [JsonProperty("max")] 207 | public double? Max { get; set; } 208 | } 209 | 210 | public class Percentile 211 | { 212 | [JsonProperty("raw")] 213 | public double? Raw { get; set; } 214 | 215 | [JsonProperty("fmt")] 216 | public string Fmt { get; set; } = string.Empty; 217 | } 218 | 219 | public class EsgScoresQuoteSummary 220 | { 221 | [JsonProperty("result")] 222 | public List Results { get; set; } = []; 223 | 224 | [JsonProperty("error")] 225 | public object Error { get; set; } = new(); 226 | } 227 | 228 | public class EsgScoresResult 229 | { 230 | [JsonProperty("esgScores")] 231 | public EsgScores EsgScores { get; set; } = new(); 232 | } 233 | 234 | public class EsgScoresData 235 | { 236 | [JsonProperty("quoteSummary")] 237 | public EsgScoresQuoteSummary QuoteSummary { get; set; } = new(); 238 | } 239 | 240 | public class SocialPercentile 241 | { 242 | [JsonProperty("raw")] 243 | public double? Raw { get; set; } 244 | 245 | [JsonProperty("fmt")] 246 | public string Fmt { get; set; } = string.Empty; 247 | } 248 | 249 | public class SocialScore 250 | { 251 | [JsonProperty("raw")] 252 | public double? Raw { get; set; } 253 | 254 | [JsonProperty("fmt")] 255 | public string Fmt { get; set; } = string.Empty; 256 | } 257 | 258 | public class TotalEsg 259 | { 260 | [JsonProperty("raw")] 261 | public double? Raw { get; set; } 262 | 263 | [JsonProperty("fmt")] 264 | public string Fmt { get; set; } = string.Empty; 265 | } -------------------------------------------------------------------------------- /src/Models/FundOwnershipData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class FundOwnership 4 | { 5 | [JsonProperty("ownershipList")] 6 | public List OwnershipList { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class FundOwnershipQuoteSummary 13 | { 14 | [JsonProperty("result")] 15 | public List Results { get; set; } = []; 16 | 17 | [JsonProperty("error")] 18 | public object Error { get; set; } = new(); 19 | } 20 | 21 | public class FundOwnershipResult 22 | { 23 | [JsonProperty("fundOwnership")] 24 | public FundOwnership FundOwnership { get; set; } = new(); 25 | } 26 | 27 | public class FundOwnershipData 28 | { 29 | [JsonProperty("quoteSummary")] 30 | public FundOwnershipQuoteSummary QuoteSummary { get; set; } = new(); 31 | } -------------------------------------------------------------------------------- /src/Models/FundProfileData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class _10y 4 | { 5 | [JsonProperty("raw")] 6 | public double? Raw { get; set; } 7 | 8 | [JsonProperty("fmt")] 9 | public string Fmt { get; set; } = string.Empty; 10 | } 11 | 12 | public class _3y 13 | { 14 | [JsonProperty("raw")] 15 | public double? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | } 20 | 21 | public class _5y 22 | { 23 | [JsonProperty("raw")] 24 | public double? Raw { get; set; } 25 | 26 | [JsonProperty("fmt")] 27 | public string Fmt { get; set; } = string.Empty; 28 | } 29 | 30 | public class AnnualReportExpenseRatio 31 | { 32 | [JsonProperty("raw")] 33 | public double? Raw { get; set; } 34 | 35 | [JsonProperty("fmt")] 36 | public string Fmt { get; set; } = string.Empty; 37 | } 38 | 39 | public class DeferredSalesLoad 40 | { 41 | [JsonProperty("raw")] 42 | public double? Raw { get; set; } 43 | 44 | [JsonProperty("fmt")] 45 | public string Fmt { get; set; } = string.Empty; 46 | } 47 | 48 | public class FeesExpensesInvestment 49 | { 50 | [JsonProperty("annualReportExpenseRatio")] 51 | public AnnualReportExpenseRatio AnnualReportExpenseRatio { get; set; } = new(); 52 | 53 | [JsonProperty("frontEndSalesLoad")] 54 | public FrontEndSalesLoad FrontEndSalesLoad { get; set; } = new(); 55 | 56 | [JsonProperty("deferredSalesLoad")] 57 | public DeferredSalesLoad DeferredSalesLoad { get; set; } = new(); 58 | 59 | [JsonProperty("twelveBOne")] 60 | public TwelveBOne TwelveBOne { get; set; } = new(); 61 | 62 | [JsonProperty("netExpRatio")] 63 | public NetExpRatio NetExpRatio { get; set; } = new(); 64 | 65 | [JsonProperty("grossExpRatio")] 66 | public GrossExpRatio GrossExpRatio { get; set; } = new(); 67 | 68 | [JsonProperty("annualHoldingsTurnover")] 69 | public AnnualHoldingsTurnover AnnualHoldingsTurnover { get; set; } = new(); 70 | 71 | [JsonProperty("totalNetAssets")] 72 | public TotalNetAssets TotalNetAssets { get; set; } = new(); 73 | 74 | [JsonProperty("projectionValues")] 75 | public ProjectionValues ProjectionValues { get; set; } = new(); 76 | } 77 | 78 | public class FeesExpensesInvestmentCat 79 | { 80 | [JsonProperty("annualReportExpenseRatio")] 81 | public AnnualReportExpenseRatio AnnualReportExpenseRatio { get; set; } = new(); 82 | 83 | [JsonProperty("frontEndSalesLoad")] 84 | public FrontEndSalesLoad FrontEndSalesLoad { get; set; } = new(); 85 | 86 | [JsonProperty("deferredSalesLoad")] 87 | public DeferredSalesLoad DeferredSalesLoad { get; set; } = new(); 88 | 89 | [JsonProperty("twelveBOne")] 90 | public TwelveBOne TwelveBOne { get; set; } = new(); 91 | 92 | [JsonProperty("annualHoldingsTurnover")] 93 | public AnnualHoldingsTurnover AnnualHoldingsTurnover { get; set; } = new(); 94 | 95 | [JsonProperty("totalNetAssets")] 96 | public TotalNetAssets TotalNetAssets { get; set; } = new(); 97 | 98 | [JsonProperty("projectionValuesCat")] 99 | public ProjectionValuesCat ProjectionValuesCat { get; set; } = new(); 100 | } 101 | 102 | public class FrontEndSalesLoad 103 | { 104 | [JsonProperty("raw")] 105 | public double? Raw { get; set; } 106 | 107 | [JsonProperty("fmt")] 108 | public string Fmt { get; set; } = string.Empty; 109 | } 110 | 111 | public class FundProfile 112 | { 113 | [JsonProperty("maxAge")] 114 | public int? MaxAge { get; set; } 115 | 116 | [JsonProperty("styleBoxUrl")] 117 | public string StyleBoxUrl { get; set; } = string.Empty; 118 | 119 | [JsonProperty("family")] 120 | public string Family { get; set; } = string.Empty; 121 | 122 | [JsonProperty("categoryName")] 123 | public string CategoryName { get; set; } = string.Empty; 124 | 125 | [JsonProperty("legalType")] 126 | public object LegalType { get; set; } = new(); 127 | 128 | [JsonProperty("managementInfo")] 129 | public ManagementInfo ManagementInfo { get; set; } = new(); 130 | 131 | [JsonProperty("feesExpensesInvestment")] 132 | public FeesExpensesInvestment FeesExpensesInvestment { get; set; } = new(); 133 | 134 | [JsonProperty("feesExpensesInvestmentCat")] 135 | public FeesExpensesInvestmentCat FeesExpensesInvestmentCat { get; set; } = new(); 136 | 137 | [JsonProperty("initInvestment")] 138 | public InitInvestment InitInvestment { get; set; } = new(); 139 | 140 | [JsonProperty("initIraInvestment")] 141 | public InitIraInvestment InitIraInvestment { get; set; } = new(); 142 | 143 | [JsonProperty("initAipInvestment")] 144 | public InitAipInvestment InitAipInvestment { get; set; } = new(); 145 | 146 | [JsonProperty("subseqInvestment")] 147 | public SubseqInvestment SubseqInvestment { get; set; } = new(); 148 | 149 | [JsonProperty("subseqIraInvestment")] 150 | public SubseqIraInvestment SubseqIraInvestment { get; set; } = new(); 151 | 152 | [JsonProperty("subseqAipInvestment")] 153 | public SubseqAipInvestment SubseqAipInvestment { get; set; } = new(); 154 | 155 | [JsonProperty("brokerages")] 156 | public List Brokerages { get; set; } = []; 157 | } 158 | 159 | public class GrossExpRatio 160 | { 161 | [JsonProperty("raw")] 162 | public double? Raw { get; set; } 163 | 164 | [JsonProperty("fmt")] 165 | public string Fmt { get; set; } = string.Empty; 166 | } 167 | 168 | public class InitAipInvestment 169 | { 170 | } 171 | 172 | public class InitInvestment 173 | { 174 | [JsonProperty("raw")] 175 | public double? Raw { get; set; } 176 | 177 | [JsonProperty("fmt")] 178 | public string Fmt { get; set; } = string.Empty; 179 | } 180 | 181 | public class InitIraInvestment 182 | { 183 | } 184 | 185 | public class ManagementInfo 186 | { 187 | [JsonProperty("managerName")] 188 | public string ManagerName { get; set; } = string.Empty; 189 | 190 | [JsonProperty("managerBio")] 191 | public string ManagerBio { get; set; } = string.Empty; 192 | 193 | [JsonProperty("startdate")] 194 | public Startdate Startdate { get; set; } = new(); 195 | } 196 | 197 | public class NetExpRatio 198 | { 199 | [JsonProperty("raw")] 200 | public double? Raw { get; set; } 201 | 202 | [JsonProperty("fmt")] 203 | public string Fmt { get; set; } = string.Empty; 204 | } 205 | 206 | public class ProjectionValues 207 | { 208 | [JsonProperty("5y")] 209 | public _5y _5y { get; set; } = new(); 210 | 211 | [JsonProperty("3y")] 212 | public _3y _3y { get; set; } = new(); 213 | 214 | [JsonProperty("10y")] 215 | public _10y _10y { get; set; } = new(); 216 | } 217 | 218 | public class ProjectionValuesCat 219 | { 220 | [JsonProperty("5y")] 221 | public _5y _5y { get; set; } = new(); 222 | 223 | [JsonProperty("3y")] 224 | public _3y _3y { get; set; } = new(); 225 | 226 | [JsonProperty("10y")] 227 | public _10y _10y { get; set; } = new(); 228 | } 229 | 230 | public class FundProfileQuoteSummary 231 | { 232 | [JsonProperty("result")] 233 | public List Results { get; set; } = []; 234 | 235 | [JsonProperty("error")] 236 | public object Error { get; set; } = new(); 237 | } 238 | 239 | public class FundProfileResult 240 | { 241 | [JsonProperty("fundProfile")] 242 | public FundProfile FundProfile { get; set; } = new(); 243 | } 244 | 245 | public class FundProfileData 246 | { 247 | [JsonProperty("quoteSummary")] 248 | public FundProfileQuoteSummary QuoteSummary { get; set; } = new(); 249 | } 250 | 251 | public class Startdate 252 | { 253 | [JsonProperty("raw")] 254 | public int? Raw { get; set; } 255 | 256 | [JsonProperty("fmt")] 257 | public string Fmt { get; set; } = string.Empty; 258 | } 259 | 260 | public class SubseqAipInvestment 261 | { 262 | } 263 | 264 | public class SubseqInvestment 265 | { 266 | [JsonProperty("raw")] 267 | public double? Raw { get; set; } 268 | 269 | [JsonProperty("fmt")] 270 | public string Fmt { get; set; } = string.Empty; 271 | } 272 | 273 | public class SubseqIraInvestment 274 | { 275 | } 276 | 277 | public class TotalNetAssets 278 | { 279 | } 280 | 281 | public class TwelveBOne 282 | { 283 | } -------------------------------------------------------------------------------- /src/Models/HistoricalData.cs: -------------------------------------------------------------------------------- 1 | // HistoricalData.cs 2 | // Andrew Baylis 3 | // Created: 11/10/2024 4 | 5 | namespace OoplesFinance.YahooFinanceAPI.Models; 6 | 7 | [Serializable] 8 | public class HistoricalDataRoot 9 | { 10 | #region Properties 11 | 12 | [JsonProperty("chart")] 13 | public Chart? Chart { get; set; } 14 | 15 | #endregion 16 | } 17 | 18 | public class Chart 19 | { 20 | #region Properties 21 | 22 | [JsonProperty("error")] 23 | public object Error { get; set; } = new(); 24 | 25 | [JsonProperty("result")] 26 | public List Result { get; set; } = []; 27 | 28 | #endregion 29 | } 30 | 31 | public class Result 32 | { 33 | #region Properties 34 | 35 | [JsonProperty("events")] 36 | public HistoricalEvent Events { get; set; } = new(); 37 | 38 | [JsonProperty("indicators")] 39 | public Indicators Indicators { get; set; } = new(); 40 | 41 | [JsonProperty("meta")] 42 | public Meta Meta { get; set; } = new(); 43 | 44 | [JsonProperty("timestamp")] 45 | public List Timestamp { get; set; } = []; 46 | 47 | #endregion 48 | } 49 | 50 | public class HistoricalEvent 51 | { 52 | #region Properties 53 | 54 | [JsonProperty("dividends")] 55 | public Dictionary DividendData { get; set; } = new(); 56 | 57 | [JsonProperty("splits")] 58 | public Dictionary SplitData { get; set; } = new(); 59 | 60 | #endregion 61 | } 62 | 63 | public class HistoricalChartInfo 64 | { 65 | #region Properties 66 | 67 | public double AdjustedClose { get; set; } 68 | 69 | public double Close { get; set; } 70 | 71 | public DateTime Date { get; set; } 72 | 73 | public double High { get; set; } 74 | 75 | public double Low { get; set; } 76 | 77 | public Meta Meta { get; set; } = new(); 78 | 79 | public double Open { get; set; } 80 | 81 | public long Volume { get; set; } 82 | 83 | #endregion 84 | } 85 | 86 | public class HistoricalFullData 87 | { 88 | #region Properties 89 | 90 | public List Dividends { get; set; } = new(); 91 | 92 | public Meta Meta { get; set; } = new(); 93 | 94 | public List Prices { get; set; } = new(); 95 | 96 | public List Splits { get; set; } = new(); 97 | 98 | #endregion 99 | } 100 | 101 | public class DividendInfo 102 | { 103 | public DividendInfo(Dividends d) 104 | { 105 | var dt = (long) d.Date.GetValueOrDefault(); 106 | Date = dt.FromUnixTimeStamp(); 107 | Amount = d.Amount; 108 | } 109 | 110 | #region Properties 111 | 112 | public double? Amount { get; set; } 113 | 114 | public DateTime Date { get; set; } 115 | 116 | #endregion 117 | } 118 | 119 | public class SplitInfo 120 | { 121 | public SplitInfo(Splits s) 122 | { 123 | Date = s.Date.GetValueOrDefault().FromUnixTimeStamp(); 124 | Denominator = s.Denominator; 125 | Numerator = s.Numerator; 126 | SplitRatio = s.SplitRatio; 127 | } 128 | 129 | #region Properties 130 | 131 | public DateTime? Date { get; set; } 132 | 133 | public long? Denominator { get; set; } 134 | 135 | public long? Numerator { get; set; } 136 | 137 | public string SplitRatio { get; set; } 138 | 139 | #endregion 140 | } -------------------------------------------------------------------------------- /src/Models/IncomeStatementHistoryQuarterlyData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class IncomeStatementHistoryItem 4 | { 5 | [JsonProperty("maxAge")] 6 | public int? MaxAge { get; set; } 7 | 8 | [JsonProperty("endDate")] 9 | public EndDate EndDate { get; set; } = new(); 10 | 11 | [JsonProperty("totalRevenue")] 12 | public TotalRevenue TotalRevenue { get; set; } = new(); 13 | 14 | [JsonProperty("costOfRevenue")] 15 | public CostOfRevenue CostOfRevenue { get; set; } = new(); 16 | 17 | [JsonProperty("grossProfit")] 18 | public GrossProfit GrossProfit { get; set; } = new(); 19 | 20 | [JsonProperty("researchDevelopment")] 21 | public ResearchDevelopment ResearchDevelopment { get; set; } = new(); 22 | 23 | [JsonProperty("sellingGeneralAdministrative")] 24 | public SellingGeneralAdministrative SellingGeneralAdministrative { get; set; } = new(); 25 | 26 | [JsonProperty("nonRecurring")] 27 | public NonRecurring NonRecurring { get; set; } = new(); 28 | 29 | [JsonProperty("otherOperatingExpenses")] 30 | public OtherOperatingExpenses OtherOperatingExpenses { get; set; } = new(); 31 | 32 | [JsonProperty("totalOperatingExpenses")] 33 | public TotalOperatingExpenses TotalOperatingExpenses { get; set; } = new(); 34 | 35 | [JsonProperty("operatingIncome")] 36 | public OperatingIncome OperatingIncome { get; set; } = new(); 37 | 38 | [JsonProperty("totalOtherIncomeExpenseNet")] 39 | public TotalOtherIncomeExpenseNet TotalOtherIncomeExpenseNet { get; set; } = new(); 40 | 41 | [JsonProperty("ebit")] 42 | public Ebit Ebit { get; set; } = new(); 43 | 44 | [JsonProperty("interestExpense")] 45 | public InterestExpense InterestExpense { get; set; } = new(); 46 | 47 | [JsonProperty("incomeBeforeTax")] 48 | public IncomeBeforeTax IncomeBeforeTax { get; set; } = new(); 49 | 50 | [JsonProperty("incomeTaxExpense")] 51 | public IncomeTaxExpense IncomeTaxExpense { get; set; } = new(); 52 | 53 | [JsonProperty("minorityInterest")] 54 | public MinorityInterest MinorityInterest { get; set; } = new(); 55 | 56 | [JsonProperty("netIncomeFromContinuingOps")] 57 | public NetIncomeFromContinuingOps NetIncomeFromContinuingOps { get; set; } = new(); 58 | 59 | [JsonProperty("discontinuedOperations")] 60 | public DiscontinuedOperations DiscontinuedOperations { get; set; } = new(); 61 | 62 | [JsonProperty("extraordinaryItems")] 63 | public ExtraordinaryItems ExtraordinaryItems { get; set; } = new(); 64 | 65 | [JsonProperty("effectOfAccountingCharges")] 66 | public EffectOfAccountingCharges EffectOfAccountingCharges { get; set; } = new(); 67 | 68 | [JsonProperty("otherItems")] 69 | public OtherItems OtherItems { get; set; } = new(); 70 | 71 | [JsonProperty("netIncome")] 72 | public NetIncome NetIncome { get; set; } = new(); 73 | 74 | [JsonProperty("netIncomeApplicableToCommonShares")] 75 | public NetIncomeApplicableToCommonShares NetIncomeApplicableToCommonShares { get; set; } = new(); 76 | } 77 | 78 | public class IncomeStatementHistoryQuarterly 79 | { 80 | [JsonProperty("incomeStatementHistory")] 81 | public List IncomeStatementHistory { get; set; } = []; 82 | 83 | [JsonProperty("maxAge")] 84 | public int? MaxAge { get; set; } 85 | } 86 | 87 | public class IncomeStatementHistoryQuarterlyQuoteSummary 88 | { 89 | [JsonProperty("result")] 90 | public List Results { get; set; } = []; 91 | 92 | [JsonProperty("error")] 93 | public object Error { get; set; } = new(); 94 | } 95 | 96 | public class IncomeStatementHistoryQuarterlyResult 97 | { 98 | [JsonProperty("incomeStatementHistoryQuarterly")] 99 | public IncomeStatementHistoryQuarterly IncomeStatementHistoryQuarterly { get; set; } = new(); 100 | } 101 | 102 | public class IncomeStatementHistoryQuarterlyData 103 | { 104 | [JsonProperty("quoteSummary")] 105 | public IncomeStatementHistoryQuarterlyQuoteSummary QuoteSummary { get; set; } = new(); 106 | } -------------------------------------------------------------------------------- /src/Models/IndexTrendData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class Estimate 4 | { 5 | [JsonProperty("period")] 6 | public string Period { get; set; } = string.Empty; 7 | 8 | [JsonProperty("growth")] 9 | public Growth Growth { get; set; } = new(); 10 | } 11 | 12 | public class Growth 13 | { 14 | [JsonProperty("raw")] 15 | public double? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | } 20 | 21 | public class IndexTrend 22 | { 23 | [JsonProperty("maxAge")] 24 | public int? MaxAge { get; set; } 25 | 26 | [JsonProperty("symbol")] 27 | public string Symbol { get; set; } = string.Empty; 28 | 29 | [JsonProperty("peRatio")] 30 | public PeRatio PeRatio { get; set; } = new(); 31 | 32 | [JsonProperty("pegRatio")] 33 | public PegRatio PegRatio { get; set; } = new(); 34 | 35 | [JsonProperty("estimates")] 36 | public List Estimates { get; set; } = []; 37 | } 38 | 39 | public class PeRatio 40 | { 41 | [JsonProperty("raw")] 42 | public double? Raw { get; set; } 43 | 44 | [JsonProperty("fmt")] 45 | public string Fmt { get; set; } = string.Empty; 46 | } 47 | 48 | public class IndexTrendQuoteSummary 49 | { 50 | [JsonProperty("result")] 51 | public List Results { get; set; } = []; 52 | 53 | [JsonProperty("error")] 54 | public object Error { get; set; } = new(); 55 | } 56 | 57 | public class IndexTrendResult 58 | { 59 | [JsonProperty("indexTrend")] 60 | public IndexTrend IndexTrend { get; set; } = new(); 61 | } 62 | 63 | public class IndexTrendData 64 | { 65 | [JsonProperty("quoteSummary")] 66 | public IndexTrendQuoteSummary QuoteSummary { get; set; } = new(); 67 | } -------------------------------------------------------------------------------- /src/Models/InsiderHolderData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class InsiderHolder 4 | { 5 | [JsonProperty("maxAge")] 6 | public int? MaxAge { get; set; } 7 | 8 | [JsonProperty("name")] 9 | public string Name { get; set; } = string.Empty; 10 | 11 | [JsonProperty("relation")] 12 | public string Relation { get; set; } = string.Empty; 13 | 14 | [JsonProperty("url")] 15 | public string Url { get; set; } = string.Empty; 16 | 17 | [JsonProperty("transactionDescription")] 18 | public string TransactionDescription { get; set; } = string.Empty; 19 | 20 | [JsonProperty("latestTransDate")] 21 | public LatestTransDate LatestTransDate { get; set; } = new(); 22 | 23 | [JsonProperty("positionDirect")] 24 | public PositionDirect PositionDirect { get; set; } = new(); 25 | 26 | [JsonProperty("positionDirectDate")] 27 | public PositionDirectDate PositionDirectDate { get; set; } = new(); 28 | 29 | [JsonProperty("positionIndirect")] 30 | public PositionIndirect PositionIndirect { get; set; } = new(); 31 | 32 | [JsonProperty("positionIndirectDate")] 33 | public PositionIndirectDate PositionIndirectDate { get; set; } = new(); 34 | } 35 | 36 | public class InsiderHolders 37 | { 38 | [JsonProperty("holders")] 39 | public List Holders { get; set; } = []; 40 | 41 | [JsonProperty("maxAge")] 42 | public int? MaxAge { get; set; } 43 | } 44 | 45 | public class LatestTransDate 46 | { 47 | [JsonProperty("raw")] 48 | public int? Raw { get; set; } 49 | 50 | [JsonProperty("fmt")] 51 | public string Fmt { get; set; } = string.Empty; 52 | } 53 | 54 | public class PositionDirect 55 | { 56 | [JsonProperty("raw")] 57 | public int? Raw { get; set; } 58 | 59 | [JsonProperty("fmt")] 60 | public string Fmt { get; set; } = string.Empty; 61 | 62 | [JsonProperty("longFmt")] 63 | public string LongFmt { get; set; } = string.Empty; 64 | } 65 | 66 | public class PositionDirectDate 67 | { 68 | [JsonProperty("raw")] 69 | public int? Raw { get; set; } 70 | 71 | [JsonProperty("fmt")] 72 | public string Fmt { get; set; } = string.Empty; 73 | } 74 | 75 | public class PositionIndirect 76 | { 77 | [JsonProperty("raw")] 78 | public int? Raw { get; set; } 79 | 80 | [JsonProperty("fmt")] 81 | public string Fmt { get; set; } = string.Empty; 82 | 83 | [JsonProperty("longFmt")] 84 | public string LongFmt { get; set; } = string.Empty; 85 | } 86 | 87 | public class PositionIndirectDate 88 | { 89 | [JsonProperty("raw")] 90 | public int? Raw { get; set; } 91 | 92 | [JsonProperty("fmt")] 93 | public string Fmt { get; set; } = string.Empty; 94 | } 95 | 96 | public class InsiderHolderQuoteSummary 97 | { 98 | [JsonProperty("result")] 99 | public List Results { get; set; } = []; 100 | 101 | [JsonProperty("error")] 102 | public object Error { get; set; } = new(); 103 | } 104 | 105 | public class InsiderHolderResult 106 | { 107 | [JsonProperty("insiderHolders")] 108 | public InsiderHolders InsiderHolders { get; set; } = new(); 109 | } 110 | 111 | public class InsiderHolderData 112 | { 113 | [JsonProperty("quoteSummary")] 114 | public InsiderHolderQuoteSummary QuoteSummary { get; set; } = new(); 115 | } -------------------------------------------------------------------------------- /src/Models/InsiderTransactionData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class InsiderTransactions 4 | { 5 | [JsonProperty("transactions")] 6 | public List Transactions { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class InsiderTransactionQuoteSummary 13 | { 14 | [JsonProperty("result")] 15 | public List Results { get; set; } = []; 16 | 17 | [JsonProperty("error")] 18 | public object Error { get; set; } = new(); 19 | } 20 | 21 | public class InsiderTransactionResult 22 | { 23 | [JsonProperty("insiderTransactions")] 24 | public InsiderTransactions InsiderTransactions { get; set; } = new(); 25 | } 26 | 27 | public class InsiderTransactionData 28 | { 29 | [JsonProperty("quoteSummary")] 30 | public InsiderTransactionQuoteSummary QuoteSummary { get; set; } = new(); 31 | } 32 | 33 | public class Shares 34 | { 35 | [JsonProperty("raw")] 36 | public int? Raw { get; set; } 37 | 38 | [JsonProperty("fmt")] 39 | public string Fmt { get; set; } = string.Empty; 40 | 41 | [JsonProperty("longFmt")] 42 | public string LongFmt { get; set; } = string.Empty; 43 | } 44 | 45 | public class StartDate 46 | { 47 | [JsonProperty("raw")] 48 | public int? Raw { get; set; } 49 | 50 | [JsonProperty("fmt")] 51 | public string Fmt { get; set; } = string.Empty; 52 | } 53 | 54 | public class Transaction 55 | { 56 | [JsonProperty("maxAge")] 57 | public int? MaxAge { get; set; } 58 | 59 | [JsonProperty("shares")] 60 | public Shares Shares { get; set; } = new(); 61 | 62 | [JsonProperty("value")] 63 | public Value Value { get; set; } = new(); 64 | 65 | [JsonProperty("filerUrl")] 66 | public string FilerUrl { get; set; } = string.Empty; 67 | 68 | [JsonProperty("transactionText")] 69 | public string TransactionText { get; set; } = string.Empty; 70 | 71 | [JsonProperty("filerName")] 72 | public string FilerName { get; set; } = string.Empty; 73 | 74 | [JsonProperty("filerRelation")] 75 | public string FilerRelation { get; set; } = string.Empty; 76 | 77 | [JsonProperty("moneyText")] 78 | public string MoneyText { get; set; } = string.Empty; 79 | 80 | [JsonProperty("startDate")] 81 | public StartDate StartDate { get; set; } = new(); 82 | 83 | [JsonProperty("ownership")] 84 | public string Ownership { get; set; } = string.Empty; 85 | } 86 | 87 | public class Value 88 | { 89 | [JsonProperty("raw")] 90 | public float? Raw { get; set; } 91 | 92 | [JsonProperty("fmt")] 93 | public string Fmt { get; set; } = string.Empty; 94 | 95 | [JsonProperty("longFmt")] 96 | public string LongFmt { get; set; } = string.Empty; 97 | } -------------------------------------------------------------------------------- /src/Models/InsightsData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class Company 4 | { 5 | [JsonProperty("innovativeness")] 6 | public double? Innovativeness { get; set; } 7 | 8 | [JsonProperty("hiring")] 9 | public double? Hiring { get; set; } 10 | 11 | [JsonProperty("sustainability")] 12 | public double? Sustainability { get; set; } 13 | 14 | [JsonProperty("insiderSentiments")] 15 | public double? InsiderSentiments { get; set; } 16 | 17 | [JsonProperty("earningsReports")] 18 | public double? EarningsReports { get; set; } 19 | 20 | [JsonProperty("dividends")] 21 | public double? Dividends { get; set; } 22 | } 23 | 24 | public class CompanySnapshot 25 | { 26 | [JsonProperty("sectorInfo")] 27 | public string SectorInfo { get; set; } = string.Empty; 28 | 29 | [JsonProperty("company")] 30 | public Company Company { get; set; } = new(); 31 | 32 | [JsonProperty("sector")] 33 | public Sector Sector { get; set; } = new(); 34 | } 35 | 36 | public class Finance 37 | { 38 | [JsonProperty("result")] 39 | public InsightsResult Result { get; set; } = new(); 40 | 41 | [JsonProperty("error")] 42 | public object Error { get; set; } = new(); 43 | } 44 | 45 | public class InstrumentInfo 46 | { 47 | [JsonProperty("technicalEvents")] 48 | public TechnicalEvents TechnicalEvents { get; set; } = new(); 49 | 50 | [JsonProperty("keyTechnicals")] 51 | public KeyTechnicals KeyTechnicals { get; set; } = new(); 52 | 53 | [JsonProperty("valuation")] 54 | public Valuation Valuation { get; set; } = new(); 55 | 56 | [JsonProperty("recommendation")] 57 | public Recommendation Recommendation { get; set; } = new(); 58 | } 59 | 60 | public class KeyTechnicals 61 | { 62 | [JsonProperty("provider")] 63 | public string Provider { get; set; } = string.Empty; 64 | 65 | [JsonProperty("support")] 66 | public double? Support { get; set; } 67 | 68 | [JsonProperty("resistance")] 69 | public double? Resistance { get; set; } 70 | 71 | [JsonProperty("stopLoss")] 72 | public double? StopLoss { get; set; } 73 | } 74 | 75 | public class Recommendation 76 | { 77 | [JsonProperty("targetPrice")] 78 | public double? TargetPrice { get; set; } 79 | 80 | [JsonProperty("provider")] 81 | public string Provider { get; set; } = string.Empty; 82 | 83 | [JsonProperty("rating")] 84 | public string Rating { get; set; } = string.Empty; 85 | } 86 | 87 | public class Report 88 | { 89 | [JsonProperty("id")] 90 | public string Id { get; set; } = string.Empty; 91 | 92 | [JsonProperty("title")] 93 | public string Title { get; set; } = string.Empty; 94 | 95 | [JsonProperty("provider")] 96 | public string Provider { get; set; } = string.Empty; 97 | 98 | [JsonProperty("publishedOn")] 99 | public DateTime? PublishedOn { get; set; } = new(); 100 | 101 | [JsonProperty("summary")] 102 | public string Summary { get; set; } = string.Empty; 103 | } 104 | 105 | public class InsightsResult 106 | { 107 | [JsonProperty("symbol")] 108 | public string Symbol { get; set; } = string.Empty; 109 | 110 | [JsonProperty("instrumentInfo")] 111 | public InstrumentInfo InstrumentInfo { get; set; } = new(); 112 | 113 | [JsonProperty("reports")] 114 | public List Reports { get; set; } = []; 115 | 116 | [JsonProperty("companySnapshot")] 117 | public CompanySnapshot CompanySnapshot { get; set; } = new(); 118 | } 119 | 120 | public class InsightsData 121 | { 122 | [JsonProperty("finance")] 123 | public Finance Finance { get; set; } = new(); 124 | } 125 | 126 | public class Sector 127 | { 128 | [JsonProperty("innovativeness")] 129 | public double? Innovativeness { get; set; } 130 | 131 | [JsonProperty("hiring")] 132 | public double? Hiring { get; set; } 133 | 134 | [JsonProperty("sustainability")] 135 | public double? Sustainability { get; set; } 136 | 137 | [JsonProperty("insiderSentiments")] 138 | public double? InsiderSentiments { get; set; } 139 | 140 | [JsonProperty("earningsReports")] 141 | public double? EarningsReports { get; set; } 142 | 143 | [JsonProperty("dividends")] 144 | public double? Dividends { get; set; } 145 | } 146 | 147 | public class TechnicalEvents 148 | { 149 | [JsonProperty("provider")] 150 | public string Provider { get; set; } = string.Empty; 151 | 152 | [JsonProperty("shortTerm")] 153 | public string ShortTerm { get; set; } = string.Empty; 154 | 155 | [JsonProperty("midTerm")] 156 | public string MidTerm { get; set; } = string.Empty; 157 | 158 | [JsonProperty("longTerm")] 159 | public string LongTerm { get; set; } = string.Empty; 160 | } 161 | 162 | public class Valuation 163 | { 164 | [JsonProperty("color")] 165 | public double? Color { get; set; } 166 | 167 | [JsonProperty("description")] 168 | public string Description { get; set; } = string.Empty; 169 | 170 | [JsonProperty("discount")] 171 | public string Discount { get; set; } = string.Empty; 172 | 173 | [JsonProperty("relativeValue")] 174 | public string RelativeValue { get; set; } = string.Empty; 175 | 176 | [JsonProperty("provider")] 177 | public string Provider { get; set; } = string.Empty; 178 | } -------------------------------------------------------------------------------- /src/Models/InstitutionData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public record InstitutionCriteriaMeta( 4 | [property: JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)] int? Size, 5 | [property: JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] int? Offset, 6 | [property: JsonProperty("sortField", NullValueHandling = NullValueHandling.Ignore)] string SortField, 7 | [property: JsonProperty("sortType", NullValueHandling = NullValueHandling.Ignore)] string SortType, 8 | [property: JsonProperty("entityIdType", NullValueHandling = NullValueHandling.Ignore)] string EntityIdType, 9 | [property: JsonProperty("criteria", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Criteria, 10 | [property: JsonProperty("topOperator", NullValueHandling = NullValueHandling.Ignore)] string TopOperator 11 | ); 12 | 13 | public record InstitutionCriterion( 14 | [property: JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)] string Field, 15 | [property: JsonProperty("operators", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Operators, 16 | [property: JsonProperty("values", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Values, 17 | [property: JsonProperty("labelsSelected", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList LabelsSelected, 18 | [property: JsonProperty("dependentValues", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList DependentValues 19 | ); 20 | 21 | public record InstitutionFinance( 22 | [property: JsonProperty("result", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Results, 23 | [property: JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)] object Error 24 | ); 25 | 26 | public record InstitutionRecord( 27 | [property: JsonProperty("ticker", NullValueHandling = NullValueHandling.Ignore)] string Ticker, 28 | [property: JsonProperty("companyName", NullValueHandling = NullValueHandling.Ignore)] string CompanyName, 29 | [property: JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] double? Price, 30 | [property: JsonProperty("pricePercentChange", NullValueHandling = NullValueHandling.Ignore)] double? PricePercentChange, 31 | [property: JsonProperty("intradayPriceChange", NullValueHandling = NullValueHandling.Ignore)] double? IntradayPriceChange, 32 | [property: JsonProperty("marketCap", NullValueHandling = NullValueHandling.Ignore)] double? MarketCap, 33 | [property: JsonProperty("dayVolume", NullValueHandling = NullValueHandling.Ignore)] long? DayVolume, 34 | [property: JsonProperty("industry", NullValueHandling = NullValueHandling.Ignore)] string Industry, 35 | [property: JsonProperty("numOfInstitutionalHolders", NullValueHandling = NullValueHandling.Ignore)] int? NumOfInstitutionalHolders, 36 | [property: JsonProperty("numOfInstitutionalHoldersPercent", NullValueHandling = NullValueHandling.Ignore)] double? NumOfInstitutionalHoldersPercent, 37 | [property: JsonProperty("percentInTopTenHoldingsOfInstitutions", NullValueHandling = NullValueHandling.Ignore)] double? PercentInTopTenHoldingsOfInstitutions, 38 | [property: JsonProperty("numOfInstitutionalBuyers", NullValueHandling = NullValueHandling.Ignore)] int? NumOfInstitutionalBuyers, 39 | [property: JsonProperty("numOfInstitutionalSellers", NullValueHandling = NullValueHandling.Ignore)] int? NumOfInstitutionalSellers, 40 | [property: JsonProperty("changeInNumOfInstitutionalHolders", NullValueHandling = NullValueHandling.Ignore)] int? ChangeInNumOfInstitutionalHolders, 41 | [property: JsonProperty("percentChangeInNumOfInstitutionalHolders", NullValueHandling = NullValueHandling.Ignore)] double? PercentChangeInNumOfInstitutionalHolders, 42 | [property: JsonProperty("numOfSharesBoughtByInstitutions", NullValueHandling = NullValueHandling.Ignore)] long? NumOfSharesBoughtByInstitutions, 43 | [property: JsonProperty("numOfSharesSoldByInstitutions", NullValueHandling = NullValueHandling.Ignore)] long? NumOfSharesSoldByInstitutions, 44 | [property: JsonProperty("changeInSharesHeldByInstitutions", NullValueHandling = NullValueHandling.Ignore)] long? ChangeInSharesHeldByInstitutions, 45 | [property: JsonProperty("percentChangeInSharesHeldByInstitutions", NullValueHandling = NullValueHandling.Ignore)] double? PercentChangeInSharesHeldByInstitutions, 46 | [property: JsonProperty("percentOfSharesOutBoughtByInstitutions", NullValueHandling = NullValueHandling.Ignore)] double? PercentOfSharesOutBoughtByInstitutions, 47 | [property: JsonProperty("percentOfSharesOutSoldByInstitutions", NullValueHandling = NullValueHandling.Ignore)] double? PercentOfSharesOutSoldByInstitutions, 48 | [property: JsonProperty("percentOfSharesOutHeldByInstitutions", NullValueHandling = NullValueHandling.Ignore)] double? PercentOfSharesOutHeldByInstitutions, 49 | [property: JsonProperty("lastReportDate", NullValueHandling = NullValueHandling.Ignore)] string LastReportDate, 50 | [property: JsonProperty("averageRating", NullValueHandling = NullValueHandling.Ignore)] string AverageRating, 51 | [property: JsonProperty("fiftyTwoWeekRange", NullValueHandling = NullValueHandling.Ignore)] string FiftyTwoWeekRange, 52 | [property: JsonProperty("logoUrl", NullValueHandling = NullValueHandling.Ignore)] string LogoUrl 53 | ); 54 | 55 | public record InstitutionResult( 56 | [property: JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] string Id, 57 | [property: JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)] string Title, 58 | [property: JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] string Description, 59 | [property: JsonProperty("canonicalName", NullValueHandling = NullValueHandling.Ignore)] string CanonicalName, 60 | [property: JsonProperty("criteriaMeta", NullValueHandling = NullValueHandling.Ignore)] CriteriaMeta CriteriaMeta, 61 | [property: JsonProperty("rawCriteria", NullValueHandling = NullValueHandling.Ignore)] string RawCriteria, 62 | [property: JsonProperty("start", NullValueHandling = NullValueHandling.Ignore)] int? Start, 63 | [property: JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] int? Count, 64 | [property: JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)] int? Total, 65 | [property: JsonProperty("records", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Records, 66 | [property: JsonProperty("userHasReadRecord", NullValueHandling = NullValueHandling.Ignore)] bool? UserHasReadRecord, 67 | [property: JsonProperty("useRecords", NullValueHandling = NullValueHandling.Ignore)] bool? UseRecords, 68 | [property: JsonProperty("predefinedScr", NullValueHandling = NullValueHandling.Ignore)] bool? PredefinedScr, 69 | [property: JsonProperty("versionId", NullValueHandling = NullValueHandling.Ignore)] int? VersionId, 70 | [property: JsonProperty("isPremium", NullValueHandling = NullValueHandling.Ignore)] bool? IsPremium, 71 | [property: JsonProperty("iconUrl", NullValueHandling = NullValueHandling.Ignore)] string IconUrl 72 | ); 73 | 74 | public record InstitutionData( 75 | [property: JsonProperty("finance", NullValueHandling = NullValueHandling.Ignore)] InstitutionFinance Finance 76 | ); 77 | -------------------------------------------------------------------------------- /src/Models/InstitutionOwnershipData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class InstitutionOwnership 4 | { 5 | [JsonProperty("ownershipList")] 6 | public List OwnershipList { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class OwnershipList 13 | { 14 | [JsonProperty("maxAge")] 15 | public int? MaxAge { get; set; } 16 | 17 | [JsonProperty("reportDate")] 18 | public ReportDate ReportDate { get; set; } = new(); 19 | 20 | [JsonProperty("organization")] 21 | public string Organization { get; set; } = string.Empty; 22 | 23 | [JsonProperty("pctHeld")] 24 | public PctHeld PctHeld { get; set; } = new(); 25 | 26 | [JsonProperty("position")] 27 | public Position Position { get; set; } = new(); 28 | 29 | [JsonProperty("value")] 30 | public Value Value { get; set; } = new(); 31 | } 32 | 33 | public class PctHeld 34 | { 35 | [JsonProperty("raw")] 36 | public double? Raw { get; set; } 37 | 38 | [JsonProperty("fmt")] 39 | public string Fmt { get; set; } = string.Empty; 40 | } 41 | 42 | public class Position 43 | { 44 | [JsonProperty("raw")] 45 | public int? Raw { get; set; } 46 | 47 | [JsonProperty("fmt")] 48 | public string Fmt { get; set; } = string.Empty; 49 | 50 | [JsonProperty("longFmt")] 51 | public string LongFmt { get; set; } = string.Empty; 52 | } 53 | 54 | public class InstitutionOwnershipQuoteSummary 55 | { 56 | [JsonProperty("result")] 57 | public List Results { get; set; } = []; 58 | 59 | [JsonProperty("error")] 60 | public object Error { get; set; } = new(); 61 | } 62 | 63 | public class ReportDate 64 | { 65 | [JsonProperty("raw")] 66 | public int? Raw { get; set; } 67 | 68 | [JsonProperty("fmt")] 69 | public string Fmt { get; set; } = string.Empty; 70 | } 71 | 72 | public class InstitutionOwnershipResult 73 | { 74 | [JsonProperty("institutionOwnership")] 75 | public InstitutionOwnership InstitutionOwnership { get; set; } = new(); 76 | } 77 | 78 | public class InstitutionOwnershipData 79 | { 80 | [JsonProperty("quoteSummary")] 81 | public InstitutionOwnershipQuoteSummary QuoteSummary { get; set; } = new(); 82 | } 83 | -------------------------------------------------------------------------------- /src/Models/MajorDirectHoldersData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class MajorDirectHolders 4 | { 5 | [JsonProperty("holders")] 6 | public List Holders { get; set; } = []; 7 | 8 | [JsonProperty("maxAge")] 9 | public int? MaxAge { get; set; } 10 | } 11 | 12 | public class MajorDirectHoldersQuoteSummary 13 | { 14 | [JsonProperty("result")] 15 | public List Results { get; set; } = []; 16 | 17 | [JsonProperty("error")] 18 | public object Error { get; set; } = new(); 19 | } 20 | 21 | public class MajorDirectHoldersResult 22 | { 23 | [JsonProperty("majorDirectHolders")] 24 | public MajorDirectHolders MajorDirectHolders { get; set; } = new(); 25 | } 26 | 27 | public class MajorDirectHoldersData 28 | { 29 | [JsonProperty("quoteSummary")] 30 | public MajorDirectHoldersQuoteSummary QuoteSummary { get; set; } = new(); 31 | } -------------------------------------------------------------------------------- /src/Models/MajorHoldersBreakdownData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class InsidersPercentHeld 4 | { 5 | [JsonProperty("raw")] 6 | public double? Raw { get; set; } 7 | 8 | [JsonProperty("fmt")] 9 | public string Fmt { get; set; } = string.Empty; 10 | } 11 | 12 | public class InstitutionsCount 13 | { 14 | [JsonProperty("raw")] 15 | public int? Raw { get; set; } 16 | 17 | [JsonProperty("fmt")] 18 | public string Fmt { get; set; } = string.Empty; 19 | 20 | [JsonProperty("longFmt")] 21 | public string LongFmt { get; set; } = string.Empty; 22 | } 23 | 24 | public class InstitutionsFloatPercentHeld 25 | { 26 | [JsonProperty("raw")] 27 | public double? Raw { get; set; } 28 | 29 | [JsonProperty("fmt")] 30 | public string Fmt { get; set; } = string.Empty; 31 | } 32 | 33 | public class InstitutionsPercentHeld 34 | { 35 | [JsonProperty("raw")] 36 | public double? Raw { get; set; } 37 | 38 | [JsonProperty("fmt")] 39 | public string Fmt { get; set; } = string.Empty; 40 | } 41 | 42 | public class MajorHoldersBreakdown 43 | { 44 | [JsonProperty("maxAge")] 45 | public int? MaxAge { get; set; } 46 | 47 | [JsonProperty("insidersPercentHeld")] 48 | public InsidersPercentHeld InsidersPercentHeld { get; set; } = new(); 49 | 50 | [JsonProperty("institutionsPercentHeld")] 51 | public InstitutionsPercentHeld InstitutionsPercentHeld { get; set; } = new(); 52 | 53 | [JsonProperty("institutionsFloatPercentHeld")] 54 | public InstitutionsFloatPercentHeld InstitutionsFloatPercentHeld { get; set; } = new(); 55 | 56 | [JsonProperty("institutionsCount")] 57 | public InstitutionsCount InstitutionsCount { get; set; } = new(); 58 | } 59 | 60 | public class MajorHoldersBreakdownQuoteSummary 61 | { 62 | [JsonProperty("result")] 63 | public List Results { get; set; } = []; 64 | 65 | [JsonProperty("error")] 66 | public object Error { get; set; } = new(); 67 | } 68 | 69 | public class MajorHoldersBreakdownResult 70 | { 71 | [JsonProperty("majorHoldersBreakdown")] 72 | public MajorHoldersBreakdown MajorHoldersBreakdown { get; set; } = new(); 73 | } 74 | 75 | public class MajorHoldersBreakdownData 76 | { 77 | [JsonProperty("quoteSummary")] 78 | public MajorHoldersBreakdownQuoteSummary QuoteSummary { get; set; } = new(); 79 | } -------------------------------------------------------------------------------- /src/Models/MarketSummaryData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public record MarketSummaryResponse( 4 | [property: JsonProperty("result")] IReadOnlyList Results, 5 | [property: JsonProperty("error")] object Error 6 | ); 7 | 8 | public record RegularMarketTime( 9 | [property: JsonProperty("raw")] int? Raw, 10 | [property: JsonProperty("fmt")] string Fmt 11 | ); 12 | 13 | public record MarketSummaryResult( 14 | [property: JsonProperty("fullExchangeName")] string FullExchangeName, 15 | [property: JsonProperty("exchangeTimezoneName")] string ExchangeTimezoneName, 16 | [property: JsonProperty("symbol")] string Symbol, 17 | [property: JsonProperty("regularMarketChange")] RegularMarketChange RegularMarketChange, 18 | [property: JsonProperty("gmtOffSetMilliseconds")] int? GmtOffSetMilliseconds, 19 | [property: JsonProperty("exchangeDataDelayedBy")] int? ExchangeDataDelayedBy, 20 | [property: JsonProperty("language")] string Language, 21 | [property: JsonProperty("regularMarketTime")] RegularMarketTime RegularMarketTime, 22 | [property: JsonProperty("exchangeTimezoneShortName")] string ExchangeTimezoneShortName, 23 | [property: JsonProperty("regularMarketChangePercent")] RegularMarketChangePercent RegularMarketChangePercent, 24 | [property: JsonProperty("quoteType")] string QuoteType, 25 | [property: JsonProperty("marketState")] string MarketState, 26 | [property: JsonProperty("regularMarketPrice")] RegularMarketPrice RegularMarketPrice, 27 | [property: JsonProperty("market")] string Market, 28 | [property: JsonProperty("quoteSourceName")] string QuoteSourceName, 29 | [property: JsonProperty("priceHint")] int? PriceHint, 30 | [property: JsonProperty("tradeable")] bool? Tradeable, 31 | [property: JsonProperty("sourceInterval")] int? SourceInterval, 32 | [property: JsonProperty("exchange")] string Exchange, 33 | [property: JsonProperty("shortName")] string ShortName, 34 | [property: JsonProperty("region")] string Region, 35 | [property: JsonProperty("triggerable")] bool? Triggerable, 36 | [property: JsonProperty("regularMarketPreviousClose")] RegularMarketPreviousClose RegularMarketPreviousClose, 37 | [property: JsonProperty("headSymbolAsString")] string HeadSymbolAsString, 38 | [property: JsonProperty("currency")] string Currency, 39 | [property: JsonProperty("longName")] string LongName 40 | ); 41 | 42 | public record MarketSummaryData( 43 | [property: JsonProperty("marketSummaryResponse")] MarketSummaryResponse MarketSummaryResponse 44 | ); -------------------------------------------------------------------------------- /src/Models/NetSharePurchaseActivityData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class BuyInfoCount 4 | { 5 | [JsonProperty("raw")] 6 | public int? Raw { get; set; } 7 | 8 | [JsonProperty("fmt")] 9 | public string Fmt { get; set; } = string.Empty; 10 | 11 | [JsonProperty("longFmt")] 12 | public string LongFmt { get; set; } = string.Empty; 13 | } 14 | 15 | public class BuyInfoShares 16 | { 17 | [JsonProperty("raw")] 18 | public int? Raw { get; set; } 19 | 20 | [JsonProperty("fmt")] 21 | public string Fmt { get; set; } = string.Empty; 22 | 23 | [JsonProperty("longFmt")] 24 | public string LongFmt { get; set; } = string.Empty; 25 | } 26 | 27 | public class BuyPercentInsiderShares 28 | { 29 | [JsonProperty("raw")] 30 | public double? Raw { get; set; } 31 | 32 | [JsonProperty("fmt")] 33 | public string Fmt { get; set; } = string.Empty; 34 | } 35 | 36 | public class NetInfoCount 37 | { 38 | [JsonProperty("raw")] 39 | public int? Raw { get; set; } 40 | 41 | [JsonProperty("fmt")] 42 | public string Fmt { get; set; } = string.Empty; 43 | 44 | [JsonProperty("longFmt")] 45 | public string LongFmt { get; set; } = string.Empty; 46 | } 47 | 48 | public class NetInfoShares 49 | { 50 | [JsonProperty("raw")] 51 | public int? Raw { get; set; } 52 | 53 | [JsonProperty("fmt")] 54 | public string Fmt { get; set; } = string.Empty; 55 | 56 | [JsonProperty("longFmt")] 57 | public string LongFmt { get; set; } = string.Empty; 58 | } 59 | 60 | public class NetPercentInsiderShares 61 | { 62 | [JsonProperty("raw")] 63 | public double? Raw { get; set; } 64 | 65 | [JsonProperty("fmt")] 66 | public string Fmt { get; set; } = string.Empty; 67 | } 68 | 69 | public class NetSharePurchaseActivity 70 | { 71 | [JsonProperty("maxAge")] 72 | public int? MaxAge { get; set; } 73 | 74 | [JsonProperty("period")] 75 | public string Period { get; set; } = string.Empty; 76 | 77 | [JsonProperty("buyInfoCount")] 78 | public BuyInfoCount BuyInfoCount { get; set; } = new(); 79 | 80 | [JsonProperty("buyInfoShares")] 81 | public BuyInfoShares BuyInfoShares { get; set; } = new(); 82 | 83 | [JsonProperty("buyPercentInsiderShares")] 84 | public BuyPercentInsiderShares BuyPercentInsiderShares { get; set; } = new(); 85 | 86 | [JsonProperty("sellInfoCount")] 87 | public SellInfoCount SellInfoCount { get; set; } = new(); 88 | 89 | [JsonProperty("sellInfoShares")] 90 | public SellInfoShares SellInfoShares { get; set; } = new(); 91 | 92 | [JsonProperty("sellPercentInsiderShares")] 93 | public SellPercentInsiderShares SellPercentInsiderShares { get; set; } = new(); 94 | 95 | [JsonProperty("netInfoCount")] 96 | public NetInfoCount NetInfoCount { get; set; } = new(); 97 | 98 | [JsonProperty("netInfoShares")] 99 | public NetInfoShares NetInfoShares { get; set; } = new(); 100 | 101 | [JsonProperty("netPercentInsiderShares")] 102 | public NetPercentInsiderShares NetPercentInsiderShares { get; set; } = new(); 103 | 104 | [JsonProperty("totalInsiderShares")] 105 | public TotalInsiderShares TotalInsiderShares { get; set; } = new(); 106 | } 107 | 108 | public class NetSharePurchaseActivityQuoteSummary 109 | { 110 | [JsonProperty("result")] 111 | public List Results { get; set; } = []; 112 | 113 | [JsonProperty("error")] 114 | public object Error { get; set; } = new(); 115 | } 116 | 117 | public class NetSharePurchaseActivityResult 118 | { 119 | [JsonProperty("netSharePurchaseActivity")] 120 | public NetSharePurchaseActivity NetSharePurchaseActivity { get; set; } = new(); 121 | } 122 | 123 | public class NetSharePurchaseActivityData 124 | { 125 | [JsonProperty("quoteSummary")] 126 | public NetSharePurchaseActivityQuoteSummary QuoteSummary { get; set; } = new(); 127 | } 128 | 129 | public class SellInfoCount 130 | { 131 | [JsonProperty("raw")] 132 | public int? Raw { get; set; } 133 | 134 | [JsonProperty("fmt")] 135 | public string Fmt { get; set; } = string.Empty; 136 | 137 | [JsonProperty("longFmt")] 138 | public string LongFmt { get; set; } = string.Empty; 139 | } 140 | 141 | public class SellInfoShares 142 | { 143 | [JsonProperty("raw")] 144 | public int? Raw { get; set; } 145 | 146 | [JsonProperty("fmt")] 147 | public string Fmt { get; set; } = string.Empty; 148 | 149 | [JsonProperty("longFmt")] 150 | public string LongFmt { get; set; } = string.Empty; 151 | } 152 | 153 | public class SellPercentInsiderShares 154 | { 155 | [JsonProperty("raw")] 156 | public double? Raw { get; set; } 157 | 158 | [JsonProperty("fmt")] 159 | public string Fmt { get; set; } = string.Empty; 160 | } 161 | 162 | public class TotalInsiderShares 163 | { 164 | [JsonProperty("raw")] 165 | public int? Raw { get; set; } 166 | 167 | [JsonProperty("fmt")] 168 | public string Fmt { get; set; } = string.Empty; 169 | 170 | [JsonProperty("longFmt")] 171 | public string LongFmt { get; set; } = string.Empty; 172 | } -------------------------------------------------------------------------------- /src/Models/PriceData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class AverageDailyVolume3Month 4 | { 5 | } 6 | 7 | public class PostMarketChange 8 | { 9 | [JsonProperty("raw")] 10 | public double? Raw { get; set; } 11 | 12 | [JsonProperty("fmt")] 13 | public string Fmt { get; set; } = string.Empty; 14 | } 15 | 16 | public class PostMarketChangePercent 17 | { 18 | [JsonProperty("raw")] 19 | public double? Raw { get; set; } 20 | 21 | [JsonProperty("fmt")] 22 | public string Fmt { get; set; } = string.Empty; 23 | } 24 | 25 | public class PostMarketPrice 26 | { 27 | [JsonProperty("raw")] 28 | public double? Raw { get; set; } 29 | 30 | [JsonProperty("fmt")] 31 | public string Fmt { get; set; } = string.Empty; 32 | } 33 | 34 | public class PreMarketChange 35 | { 36 | } 37 | 38 | public class PreMarketPrice 39 | { 40 | } 41 | 42 | public class Price 43 | { 44 | [JsonProperty("maxAge")] 45 | public int? MaxAge { get; set; } 46 | 47 | [JsonProperty("preMarketChange")] 48 | public PreMarketChange PreMarketChange { get; set; } = new(); 49 | 50 | [JsonProperty("preMarketPrice")] 51 | public PreMarketPrice PreMarketPrice { get; set; } = new(); 52 | 53 | [JsonProperty("preMarketSource")] 54 | public string PreMarketSource { get; set; } = string.Empty; 55 | 56 | [JsonProperty("postMarketChangePercent")] 57 | public PostMarketChangePercent PostMarketChangePercent { get; set; } = new(); 58 | 59 | [JsonProperty("postMarketChange")] 60 | public PostMarketChange PostMarketChange { get; set; } = new(); 61 | 62 | [JsonProperty("postMarketTime")] 63 | public int? PostMarketTime { get; set; } 64 | 65 | [JsonProperty("postMarketPrice")] 66 | public PostMarketPrice PostMarketPrice { get; set; } = new(); 67 | 68 | [JsonProperty("postMarketSource")] 69 | public string PostMarketSource { get; set; } = string.Empty; 70 | 71 | [JsonProperty("regularMarketChangePercent")] 72 | public RegularMarketChangePercent RegularMarketChangePercent { get; set; } = new(); 73 | 74 | [JsonProperty("regularMarketChange")] 75 | public RegularMarketChange RegularMarketChange { get; set; } = new(); 76 | 77 | [JsonProperty("regularMarketTime")] 78 | public int? RegularMarketTime { get; set; } 79 | 80 | [JsonProperty("priceHint")] 81 | public PriceHint PriceHint { get; set; } = new(); 82 | 83 | [JsonProperty("regularMarketPrice")] 84 | public RegularMarketPrice RegularMarketPrice { get; set; } = new(); 85 | 86 | [JsonProperty("regularMarketDayHigh")] 87 | public RegularMarketDayHigh RegularMarketDayHigh { get; set; } = new(); 88 | 89 | [JsonProperty("regularMarketDayLow")] 90 | public RegularMarketDayLow RegularMarketDayLow { get; set; } = new(); 91 | 92 | [JsonProperty("regularMarketVolume")] 93 | public RegularMarketVolume RegularMarketVolume { get; set; } = new(); 94 | 95 | [JsonProperty("averageDailyVolume10Day")] 96 | public AverageDailyVolume10Day AverageDailyVolume10Day { get; set; } = new(); 97 | 98 | [JsonProperty("averageDailyVolume3Month")] 99 | public AverageDailyVolume3Month AverageDailyVolume3Month { get; set; } = new(); 100 | 101 | [JsonProperty("regularMarketPreviousClose")] 102 | public RegularMarketPreviousClose RegularMarketPreviousClose { get; set; } = new(); 103 | 104 | [JsonProperty("regularMarketSource")] 105 | public string RegularMarketSource { get; set; } = string.Empty; 106 | 107 | [JsonProperty("regularMarketOpen")] 108 | public RegularMarketOpen RegularMarketOpen { get; set; } = new(); 109 | 110 | [JsonProperty("strikePrice")] 111 | public StrikePrice StrikePrice { get; set; } = new(); 112 | 113 | [JsonProperty("openInterest")] 114 | public OpenInterest OpenInterest { get; set; } = new(); 115 | 116 | [JsonProperty("exchange")] 117 | public string Exchange { get; set; } = string.Empty; 118 | 119 | [JsonProperty("exchangeName")] 120 | public string ExchangeName { get; set; } = string.Empty; 121 | 122 | [JsonProperty("exchangeDataDelayedBy")] 123 | public int? ExchangeDataDelayedBy { get; set; } 124 | 125 | [JsonProperty("marketState")] 126 | public string MarketState { get; set; } = string.Empty; 127 | 128 | [JsonProperty("quoteType")] 129 | public string QuoteType { get; set; } = string.Empty; 130 | 131 | [JsonProperty("symbol")] 132 | public string Symbol { get; set; } = string.Empty; 133 | 134 | [JsonProperty("underlyingSymbol")] 135 | public object UnderlyingSymbol { get; set; } = new(); 136 | 137 | [JsonProperty("shortName")] 138 | public string ShortName { get; set; } = string.Empty; 139 | 140 | [JsonProperty("longName")] 141 | public string LongName { get; set; } = string.Empty; 142 | 143 | [JsonProperty("currency")] 144 | public string Currency { get; set; } = string.Empty; 145 | 146 | [JsonProperty("quoteSourceName")] 147 | public string QuoteSourceName { get; set; } = string.Empty; 148 | 149 | [JsonProperty("currencySymbol")] 150 | public string CurrencySymbol { get; set; } = string.Empty; 151 | 152 | [JsonProperty("fromCurrency")] 153 | public object FromCurrency { get; set; } = new(); 154 | 155 | [JsonProperty("lastMarket")] 156 | public object LastMarket { get; set; } = new(); 157 | 158 | [JsonProperty("volume24Hr")] 159 | public Volume24Hr Volume24Hr { get; set; } = new(); 160 | 161 | [JsonProperty("volumeAllCurrencies")] 162 | public VolumeAllCurrencies VolumeAllCurrencies { get; set; } = new(); 163 | 164 | [JsonProperty("circulatingSupply")] 165 | public CirculatingSupply CirculatingSupply { get; set; } = new(); 166 | 167 | [JsonProperty("marketCap")] 168 | public MarketCap MarketCap { get; set; } = new(); 169 | } 170 | 171 | public class PriceQuoteSummary 172 | { 173 | [JsonProperty("result")] 174 | public List Results { get; set; } = []; 175 | 176 | [JsonProperty("error")] 177 | public object Error { get; set; } = new(); 178 | } 179 | 180 | public class RegularMarketChange 181 | { 182 | [JsonProperty("raw")] 183 | public double? Raw { get; set; } 184 | 185 | [JsonProperty("fmt")] 186 | public string Fmt { get; set; } = string.Empty; 187 | } 188 | 189 | public class RegularMarketChangePercent 190 | { 191 | [JsonProperty("raw")] 192 | public double? Raw { get; set; } 193 | 194 | [JsonProperty("fmt")] 195 | public string Fmt { get; set; } = string.Empty; 196 | } 197 | 198 | public class RegularMarketPrice 199 | { 200 | [JsonProperty("raw")] 201 | public double? Raw { get; set; } 202 | 203 | [JsonProperty("fmt")] 204 | public string Fmt { get; set; } = string.Empty; 205 | } 206 | 207 | public class PriceResult 208 | { 209 | [JsonProperty("price")] 210 | public Price Price { get; set; } = new(); 211 | } 212 | 213 | public class PriceData 214 | { 215 | [JsonProperty("quoteSummary")] 216 | public PriceQuoteSummary QuoteSummary { get; set; } = new(); 217 | } -------------------------------------------------------------------------------- /src/Models/QuoteTypeData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class QuoteTypeQuoteSummary 4 | { 5 | [JsonProperty("result")] 6 | public List Results { get; set; } = []; 7 | 8 | [JsonProperty("error")] 9 | public object Error { get; set; } = new(); 10 | } 11 | 12 | public class QuoteType 13 | { 14 | [JsonProperty("exchange")] 15 | public string Exchange { get; set; } = string.Empty; 16 | 17 | [JsonProperty("quoteType")] 18 | public string QuoteTypeInfo { get; set; } = string.Empty; 19 | 20 | [JsonProperty("symbol")] 21 | public string Symbol { get; set; } = string.Empty; 22 | 23 | [JsonProperty("underlyingSymbol")] 24 | public string UnderlyingSymbol { get; set; } = string.Empty; 25 | 26 | [JsonProperty("shortName")] 27 | public string ShortName { get; set; } = string.Empty; 28 | 29 | [JsonProperty("longName")] 30 | public string LongName { get; set; } = string.Empty; 31 | 32 | [JsonProperty("firstTradeDateEpochUtc")] 33 | public int? FirstTradeDateEpochUtc { get; set; } 34 | 35 | [JsonProperty("timeZoneFullName")] 36 | public string TimeZoneFullName { get; set; } = string.Empty; 37 | 38 | [JsonProperty("timeZoneShortName")] 39 | public string TimeZoneShortName { get; set; } = string.Empty; 40 | 41 | [JsonProperty("uuid")] 42 | public string Uuid { get; set; } = string.Empty; 43 | 44 | [JsonProperty("gmtOffSetMilliseconds")] 45 | public int? GmtOffSetMilliseconds { get; set; } 46 | 47 | [JsonProperty("maxAge")] 48 | public int? MaxAge { get; set; } 49 | } 50 | 51 | public class QuoteTypeResult 52 | { 53 | [JsonProperty("quoteType")] 54 | public QuoteType QuoteType { get; set; } = new(); 55 | } 56 | 57 | public class QuoteTypeData 58 | { 59 | [JsonProperty("quoteSummary")] 60 | public QuoteTypeQuoteSummary QuoteSummary { get; set; } = new(); 61 | } -------------------------------------------------------------------------------- /src/Models/RecommendData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class RecommendFinance 4 | { 5 | [JsonProperty("result")] 6 | public List Results { get; set; } = []; 7 | 8 | [JsonProperty("error")] 9 | public object Error { get; set; } = new(); 10 | } 11 | 12 | public class RecommendedSymbol 13 | { 14 | [JsonProperty("symbol")] 15 | public string Symbol { get; set; } = string.Empty; 16 | 17 | [JsonProperty("score")] 18 | public double Score { get; set; } 19 | } 20 | 21 | public class RecommendResult 22 | { 23 | [JsonProperty("symbol")] 24 | public string Symbol { get; set; } = string.Empty; 25 | 26 | [JsonProperty("recommendedSymbols")] 27 | public List RecommendedSymbols { get; set; } = []; 28 | } 29 | 30 | public class RecommendData 31 | { 32 | [JsonProperty("finance")] 33 | public RecommendFinance Finance { get; set; } = new(); 34 | } -------------------------------------------------------------------------------- /src/Models/RecommendationTrendData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class RecommendationTrendQuoteSummary 4 | { 5 | [JsonProperty("result")] 6 | public List Results { get; set; } = []; 7 | 8 | [JsonProperty("error")] 9 | public object Error { get; set; } = new(); 10 | } 11 | 12 | public class RecommendationTrend 13 | { 14 | [JsonProperty("trend")] 15 | public List Trend { get; set; } = []; 16 | 17 | [JsonProperty("maxAge")] 18 | public int? MaxAge { get; set; } 19 | } 20 | 21 | public class RecommendationTrendResult 22 | { 23 | [JsonProperty("recommendationTrend")] 24 | public RecommendationTrend RecommendationTrend { get; set; } = new(); 25 | } 26 | 27 | public class RecommendationTrendData 28 | { 29 | [JsonProperty("quoteSummary")] 30 | public RecommendationTrendQuoteSummary QuoteSummary { get; set; } = new(); 31 | } 32 | 33 | public class Trend 34 | { 35 | [JsonProperty("period")] 36 | public string Period { get; set; } = string.Empty; 37 | 38 | [JsonProperty("strongBuy")] 39 | public int? StrongBuy { get; set; } 40 | 41 | [JsonProperty("buy")] 42 | public int? Buy { get; set; } 43 | 44 | [JsonProperty("hold")] 45 | public int? Hold { get; set; } 46 | 47 | [JsonProperty("sell")] 48 | public int? Sell { get; set; } 49 | 50 | [JsonProperty("strongSell")] 51 | public int? StrongSell { get; set; } 52 | } -------------------------------------------------------------------------------- /src/Models/SecFilingsData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class Filing 4 | { 5 | [JsonProperty("date")] 6 | public DateTime Date { get; set; } = new(); 7 | 8 | [JsonProperty("epochDate")] 9 | public int? EpochDate { get; set; } 10 | 11 | [JsonProperty("type")] 12 | public string Type { get; set; } = string.Empty; 13 | 14 | [JsonProperty("title")] 15 | public string Title { get; set; } = string.Empty; 16 | 17 | [JsonProperty("url")] 18 | public string Url { get; set; } = string.Empty; 19 | 20 | [JsonProperty("edgarUrl")] 21 | public string EdgarUrl { get; set; } = string.Empty; 22 | 23 | [JsonProperty("maxAge")] 24 | public int? MaxAge { get; set; } 25 | } 26 | 27 | public class SecFilingsQuoteSummary 28 | { 29 | [JsonProperty("result")] 30 | public List Results { get; set; } = []; 31 | 32 | [JsonProperty("error")] 33 | public object Error { get; set; } = new(); 34 | } 35 | 36 | public class SecFilingsResult 37 | { 38 | [JsonProperty("secFilings")] 39 | public SecFilings SecFilings { get; set; } = new(); 40 | } 41 | 42 | public class SecFilingsData 43 | { 44 | [JsonProperty("quoteSummary")] 45 | public SecFilingsQuoteSummary QuoteSummary { get; set; } = new(); 46 | } 47 | 48 | public class SecFilings 49 | { 50 | [JsonProperty("filings")] 51 | public List Filings { get; set; } = []; 52 | 53 | [JsonProperty("maxAge")] 54 | public int? MaxAge { get; set; } 55 | } -------------------------------------------------------------------------------- /src/Models/SectorTrendData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class SectorTrendQuoteSummary 4 | { 5 | [JsonProperty("result")] 6 | public List Results { get; set; } = []; 7 | 8 | [JsonProperty("error")] 9 | public object Error { get; set; } = new(); 10 | } 11 | 12 | public class SectorTrendResult 13 | { 14 | [JsonProperty("sectorTrend")] 15 | public SectorTrend SectorTrend { get; set; } = new(); 16 | } 17 | 18 | public class SectorTrendData 19 | { 20 | [JsonProperty("quoteSummary")] 21 | public SectorTrendQuoteSummary QuoteSummary { get; set; } = new(); 22 | } 23 | 24 | public class SectorTrend 25 | { 26 | [JsonProperty("maxAge")] 27 | public int? MaxAge { get; set; } 28 | 29 | [JsonProperty("symbol")] 30 | public object Symbol { get; set; } = new(); 31 | 32 | [JsonProperty("peRatio")] 33 | public PeRatio PeRatio { get; set; } = new(); 34 | 35 | [JsonProperty("pegRatio")] 36 | public PegRatio PegRatio { get; set; } = new(); 37 | 38 | [JsonProperty("estimates")] 39 | public List Estimates { get; set; } = []; 40 | } -------------------------------------------------------------------------------- /src/Models/SparkChartData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class SparkInfo 4 | { 5 | [JsonProperty("timestamp")] 6 | public List Timestamp { get; set; } = []; 7 | 8 | [JsonProperty("symbol")] 9 | public string Symbol { get; set; } = string.Empty; 10 | 11 | [JsonProperty("previousClose")] 12 | public object PreviousClose { get; set; } = new(); 13 | 14 | [JsonProperty("chartPreviousClose")] 15 | public double? ChartPreviousClose { get; set; } 16 | 17 | [JsonProperty("dataGranularity")] 18 | public int? DataGranularity { get; set; } 19 | 20 | [JsonProperty("end")] 21 | public object End { get; set; } = new(); 22 | 23 | [JsonProperty("start")] 24 | public object Start { get; set; } = new(); 25 | 26 | [JsonProperty("close")] 27 | public List Close { get; set; } = []; 28 | } -------------------------------------------------------------------------------- /src/Models/StockSplitData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | [Serializable] 4 | 5 | public class StockSplitRoot 6 | { 7 | [JsonProperty("chart")] 8 | public StockSplitChart Chart { get; set; } = new(); 9 | } 10 | 11 | public class StockSplitResult 12 | { 13 | [JsonProperty("meta")] 14 | public Meta Meta { get; set; } = new(); 15 | 16 | [JsonProperty("timestamp")] 17 | public List Timestamp { get; set; } = []; 18 | 19 | [JsonProperty("events")] 20 | public StockSplitEvents Events { get; set; } = new(); 21 | 22 | [JsonProperty("indicators")] 23 | public Indicators Indicators { get; set; } = new(); 24 | } 25 | 26 | public class StockSplitChart 27 | { 28 | [JsonProperty("result")] 29 | public List Result { get; set; } = []; 30 | 31 | [JsonProperty("error")] 32 | public object Error { get; set; } = new(); 33 | } 34 | 35 | public class StockSplitEvents 36 | { 37 | [JsonProperty("splits")] 38 | public Dictionary SplitData { get; set; } = []; 39 | } 40 | 41 | public partial class SplitItem 42 | { 43 | public long Name {get; set;} 44 | public Splits SplitDataObject { get; set; } = new(); 45 | } 46 | 47 | public class Splits 48 | { 49 | [JsonProperty("date")] 50 | public long? Date { get; set; } 51 | 52 | [JsonProperty("numerator")] 53 | public long? Numerator { get; set; } 54 | 55 | [JsonProperty("denominator")] 56 | public long? Denominator { get; set; } 57 | 58 | [JsonProperty("splitRatio")] 59 | public string SplitRatio { get; set; } = string.Empty; 60 | } -------------------------------------------------------------------------------- /src/Models/StocksOwnedData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public record StocksOwnedCriteriaMeta( 4 | [property: JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)] int? Size, 5 | [property: JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] int? Offset, 6 | [property: JsonProperty("sortField", NullValueHandling = NullValueHandling.Ignore)] string SortField, 7 | [property: JsonProperty("sortType", NullValueHandling = NullValueHandling.Ignore)] string SortType, 8 | [property: JsonProperty("entityIdType", NullValueHandling = NullValueHandling.Ignore)] string EntityIdType, 9 | [property: JsonProperty("criteria", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Criteria, 10 | [property: JsonProperty("topOperator", NullValueHandling = NullValueHandling.Ignore)] string TopOperator 11 | ); 12 | 13 | public record StocksOwnedCriterion( 14 | [property: JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)] string Field, 15 | [property: JsonProperty("operators", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Operators, 16 | [property: JsonProperty("values", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Values, 17 | [property: JsonProperty("labelsSelected", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList LabelsSelected, 18 | [property: JsonProperty("dependentValues", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList DependentValues 19 | ); 20 | 21 | public record StocksOwnedFinance( 22 | [property: JsonProperty("result", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Results, 23 | [property: JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)] object Error 24 | ); 25 | 26 | public record StocksOwnedRecord( 27 | [property: JsonProperty("formType", NullValueHandling = NullValueHandling.Ignore)] string FormType, 28 | [property: JsonProperty("ticker", NullValueHandling = NullValueHandling.Ignore)] string Ticker, 29 | [property: JsonProperty("companyName", NullValueHandling = NullValueHandling.Ignore)] string CompanyName, 30 | [property: JsonProperty("fileDate", NullValueHandling = NullValueHandling.Ignore)] object FileDate, 31 | [property: JsonProperty("fundName", NullValueHandling = NullValueHandling.Ignore)] string FundName, 32 | [property: JsonProperty("fundType", NullValueHandling = NullValueHandling.Ignore)] string FundType, 33 | [property: JsonProperty("prevShares", NullValueHandling = NullValueHandling.Ignore)] int? PrevShares, 34 | [property: JsonProperty("currentShares", NullValueHandling = NullValueHandling.Ignore)] int? CurrentShares, 35 | [property: JsonProperty("percentChangeInShares", NullValueHandling = NullValueHandling.Ignore)] double? PercentChangeInShares, 36 | [property: JsonProperty("ownershipPercent", NullValueHandling = NullValueHandling.Ignore)] double? OwnershipPercent, 37 | [property: JsonProperty("percentChangeInOwnership", NullValueHandling = NullValueHandling.Ignore)] double? PercentChangeInOwnership, 38 | [property: JsonProperty("percentOfSharesOutstanding", NullValueHandling = NullValueHandling.Ignore)] double? PercentOfSharesOutstanding, 39 | [property: JsonProperty("fundAum", NullValueHandling = NullValueHandling.Ignore)] object FundAum, 40 | [property: JsonProperty("logoUrl", NullValueHandling = NullValueHandling.Ignore)] string LogoUrl 41 | ); 42 | 43 | public record StocksOwnedResult( 44 | [property: JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] string Id, 45 | [property: JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)] string Title, 46 | [property: JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] string Description, 47 | [property: JsonProperty("canonicalName", NullValueHandling = NullValueHandling.Ignore)] string CanonicalName, 48 | [property: JsonProperty("criteriaMeta", NullValueHandling = NullValueHandling.Ignore)] StocksOwnedCriteriaMeta CriteriaMeta, 49 | [property: JsonProperty("rawCriteria", NullValueHandling = NullValueHandling.Ignore)] string RawCriteria, 50 | [property: JsonProperty("start", NullValueHandling = NullValueHandling.Ignore)] int? Start, 51 | [property: JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] int? Count, 52 | [property: JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)] int? Total, 53 | [property: JsonProperty("records", NullValueHandling = NullValueHandling.Ignore)] IReadOnlyList Records, 54 | [property: JsonProperty("userHasReadRecord", NullValueHandling = NullValueHandling.Ignore)] bool? UserHasReadRecord, 55 | [property: JsonProperty("useRecords", NullValueHandling = NullValueHandling.Ignore)] bool? UseRecords, 56 | [property: JsonProperty("predefinedScr", NullValueHandling = NullValueHandling.Ignore)] bool? PredefinedScr, 57 | [property: JsonProperty("versionId", NullValueHandling = NullValueHandling.Ignore)] int? VersionId, 58 | [property: JsonProperty("isPremium", NullValueHandling = NullValueHandling.Ignore)] bool? IsPremium, 59 | [property: JsonProperty("iconUrl", NullValueHandling = NullValueHandling.Ignore)] string IconUrl 60 | ); 61 | 62 | public record StocksOwnedData( 63 | [property: JsonProperty("finance", NullValueHandling = NullValueHandling.Ignore)] StocksOwnedFinance Finance 64 | ); 65 | -------------------------------------------------------------------------------- /src/Models/TrendingData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | internal class TrendingFinance 4 | { 5 | [JsonProperty("result")] 6 | public List Results { get; set; } = []; 7 | 8 | [JsonProperty("error")] 9 | public object Error { get; set; } = new(); 10 | } 11 | 12 | internal class TrendingQuote 13 | { 14 | [JsonProperty("symbol")] 15 | public string Symbol { get; set; } = string.Empty; 16 | } 17 | 18 | internal class TrendingResult 19 | { 20 | [JsonProperty("count")] 21 | public int? Count { get; set; } 22 | 23 | [JsonProperty("quotes")] 24 | public List Quotes { get; set; } = []; 25 | 26 | [JsonProperty("jobTimestamp")] 27 | public long? JobTimestamp { get; set; } 28 | 29 | [JsonProperty("startInterval")] 30 | public long? StartInterval { get; set; } 31 | } 32 | 33 | internal class TrendingData 34 | { 35 | [JsonProperty("finance")] 36 | public TrendingFinance Finance { get; set; } = new(); 37 | } -------------------------------------------------------------------------------- /src/Models/UpgradeDowngradeHistoryData.cs: -------------------------------------------------------------------------------- 1 | namespace OoplesFinance.YahooFinanceAPI.Models; 2 | 3 | public class History 4 | { 5 | [JsonProperty("epochGradeDate")] 6 | public int? EpochGradeDate { get; set; } 7 | 8 | [JsonProperty("firm")] 9 | public string Firm { get; set; } = string.Empty; 10 | 11 | [JsonProperty("toGrade")] 12 | public string ToGrade { get; set; } = string.Empty; 13 | 14 | [JsonProperty("fromGrade")] 15 | public string FromGrade { get; set; } = string.Empty; 16 | 17 | [JsonProperty("action")] 18 | public string Action { get; set; } = string.Empty; 19 | } 20 | 21 | public class UpgradeDowngradeHistoryQuoteSummary 22 | { 23 | [JsonProperty("result")] 24 | public List Results { get; set; } = []; 25 | 26 | [JsonProperty("error")] 27 | public object Error { get; set; } = new(); 28 | } 29 | 30 | public class UpgradeDowngradeHistoryResult 31 | { 32 | [JsonProperty("upgradeDowngradeHistory")] 33 | public UpgradeDowngradeHistory UpgradeDowngradeHistory { get; set; } = new(); 34 | } 35 | 36 | public class UpgradeDowngradeHistoryData 37 | { 38 | [JsonProperty("quoteSummary")] 39 | public UpgradeDowngradeHistoryQuoteSummary QuoteSummary { get; set; } = new(); 40 | } 41 | 42 | public class UpgradeDowngradeHistory 43 | { 44 | [JsonProperty("history")] 45 | public List History { get; set; } = []; 46 | 47 | [JsonProperty("maxAge")] 48 | public int? MaxAge { get; set; } 49 | } -------------------------------------------------------------------------------- /src/OoplesFinance.YahooFinanceAPI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0;net48 5 | enable 6 | enable 7 | latest 8 | True 9 | True 10 | Ooples Finance Yahoo Finance API 11 | 1.7 12 | ooples 13 | Ooples Finance 14 | Ooples Finance LLC 2022-2023 15 | A C# library to be able to scrape free stock market data from Yahoo Finance. Can get historical data, top trending stocks, capital gains, dividends, stock splits, stock recommendations and so much more! Supports at least 39 different types of data and many more coming soon! 16 | git 17 | README.md 18 | Apache-2.0 19 | True 20 | en-US 21 | yahoo; finance; stock; stocks; stock market; market; financial api; financial; financials; stock prices; stock api; yahoo finance; scraping; scraper; web api; api 22 | https://github.com/ooples/OoplesFinance.YahooFinanceAPI 23 | Favicon.jpg 24 | https://github.com/ooples/OoplesFinance.YahooFinanceAPI 25 | https://github.com/ooples/OoplesFinance.YahooFinanceAPI/releases 26 | True 27 | snupkg 28 | False 29 | True 30 | 31 | 32 | 33 | True 34 | 35 | 36 | 37 | True 38 | 39 | 40 | 41 | True 42 | 43 | 44 | 45 | True 46 | 47 | 48 | 49 | True 50 | 51 | 52 | 53 | True 54 | 55 | 56 | 57 | True 58 | 59 | 60 | 61 | True 62 | 63 | 64 | 65 | True 66 | 67 | 68 | 69 | True 70 | 71 | 72 | 73 | True 74 | 75 | 76 | 77 | True 78 | 79 | 80 | 81 | True 82 | 83 | 84 | 85 | True 86 | 87 | 88 | 89 | True 90 | 91 | 92 | 93 | True 94 | 95 | 96 | 97 | True 98 | 99 | 100 | 101 | True 102 | 103 | 104 | 105 | True 106 | 107 | 108 | 109 | True 110 | 111 | 112 | 113 | True 114 | 115 | 116 | 117 | True 118 | 119 | 120 | 121 | True 122 | 123 | 124 | 125 | True 126 | 127 | 128 | 129 | True 130 | 131 | 132 | 133 | True 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | <_Parameter1>OoplesFinance.YahooFinanceAPI.Tests.Unit 145 | 146 | 147 | 148 | 149 | 150 | all 151 | runtime; build; native; contentfiles; analyzers; buildtransitive 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | True 161 | \ 162 | 163 | 164 | True 165 | \ 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /tests/TestConsoleApp/Program.cs: -------------------------------------------------------------------------------- 1 | using OoplesFinance.YahooFinanceAPI; 2 | using OoplesFinance.YahooFinanceAPI.Enums; 3 | 4 | try 5 | { 6 | var startDate = DateTime.Now.AddYears(-10); 7 | var symbol = "GOOG"; 8 | var fundSymbol = "VSMPX"; 9 | var symbols = new string[] { symbol, "MSFT", "NFLX", "TSLA", "YHOO", "SPY", "A", "AA", "GOOG", "F", "UBER", "LYFT" }; 10 | 11 | var yahooClient = new YahooClient(); 12 | 13 | var historicalDataList = await yahooClient.GetHistoricalDataAsync(symbol, DataFrequency.Daily, startDate); 14 | var chartInfoList = await yahooClient.GetChartInfoAsync("GOOG", TimeRange._1Year, TimeInterval._1Day); 15 | Console.WriteLine(); 16 | //var capitalGainList = await yahooClient.GetCapitalGainDataAsync(symbol, DataFrequency.Monthly, startDate); 17 | //var dividendList = await yahooClient.GetDividendDataAsync(symbol, DataFrequency.Weekly, startDate); 18 | //var stockSplitList = await yahooClient.GetStockSplitDataAsync(symbol, DataFrequency.Monthly, startDate); 19 | //var topTrendingList = await yahooClient.GetTopTrendingStocksAsync(Country.UnitedStates, 10); 20 | //var recommendedList = await yahooClient.GetStockRecommendationsAsync(symbol); 21 | //var keyStatsList = await yahooClient.GetKeyStatisticsAsync(symbol); 22 | //var summaryDetailsList = await yahooClient.GetSummaryDetailsAsync(symbol); 23 | //var insiderHoldersList = await yahooClient.GetInsiderHoldersAsync(symbol); 24 | //var insiderTransactionsList = await yahooClient.GetInsiderTransactionsAsync(symbol); 25 | //var financialDataList = await yahooClient.GetFinancialDataAsync(symbol); 26 | //var institutionOwnershipList = await yahooClient.GetInstitutionOwnershipAsync(symbol); 27 | //var fundOwnershipList = await yahooClient.GetFundOwnershipAsync(symbol); 28 | //var majorDirectHoldersList = await yahooClient.GetMajorDirectHoldersAsync(symbol); 29 | //var secFilingsList = await yahooClient.GetSecFilingsAsync(symbol); 30 | //var insightsList = await yahooClient.GetInsightsAsync(symbol); 31 | //var majorHoldersBreakdownList = await yahooClient.GetMajorHoldersBreakdownAsync(symbol); 32 | //var upgradeDowngradeHistoryList = await yahooClient.GetUpgradeDowngradeHistoryAsync(symbol); 33 | //var esgScoresList = await yahooClient.GetEsgScoresAsync(symbol); 34 | //var recommendationTrendList = await yahooClient.GetRecommendationTrendAsync(symbol); 35 | //var indexTrendList = await yahooClient.GetIndexTrendAsync(symbol); 36 | //var sectorTrendList = await yahooClient.GetSectorTrendAsync(symbol); 37 | //var earningsTrendList = await yahooClient.GetEarningsTrendAsync(symbol); 38 | //var assetProfileList = await yahooClient.GetAssetProfileAsync(symbol); 39 | //var fundProfileList = await yahooClient.GetFundProfileAsync(fundSymbol); 40 | //var calendarEventsList = await yahooClient.GetCalendarEventsAsync(symbol); 41 | //var earningsList = await yahooClient.GetEarningsAsync(symbol); 42 | //var balanceSheetHistoryList = await yahooClient.GetBalanceSheetHistoryAsync(symbol); 43 | //var cashflowStatementHistoryList = await yahooClient.GetCashflowStatementHistoryAsync(symbol); 44 | //var incomeStatementHistoryList = await yahooClient.GetIncomeStatementHistoryAsync(symbol); 45 | //var earningsHistoryList = await yahooClient.GetEarningsHistoryAsync(symbol); 46 | //var quoteTypeList = await yahooClient.GetQuoteTypeAsync(symbol); 47 | //var priceList = await yahooClient.GetPriceInfoAsync(symbol); 48 | //var netSharePurchaseActivityList = await yahooClient.GetNetSharePurchaseActivityAsync(symbol); 49 | //var incomeStatementHistoryQuarterlyList = await yahooClient.GetIncomeStatementHistoryQuarterlyAsync(symbol); 50 | //var cashflowStatementHistoryQuarterlyList = await yahooClient.GetCashflowStatementHistoryQuarterlyAsync(symbol); 51 | //var balanceSheetHistoryQuarterlyList = await yahooClient.GetBalanceSheetHistoryQuarterlyAsync(symbol); 52 | //var sparkChartInfoList = await yahooClient.GetSparkChartInfoAsync(symbols, TimeRange._1Month, TimeInterval._1Day); 53 | //var realTimeQuoteList = await yahooClient.GetRealTimeQuotesAsync(symbols); 54 | //var marketSummaryList = await yahooClient.GetMarketSummaryAsync(); 55 | //var autoCompleteList = await yahooClient.GetAutoCompleteInfoAsync("Google"); 56 | //var topGainersList = await yahooClient.GetTopGainersAsync(10); 57 | //var topLosersList = await yahooClient.GetTopLosersAsync(10); 58 | //var smallCapGainersList = await yahooClient.GetSmallCapGainersAsync(10); 59 | //var mostActiveStocksList = await yahooClient.GetMostActiveStocksAsync(10); 60 | //var aggressiveSmallCapsList = await yahooClient.GetAggressiveSmallCapStocksAsync(10); 61 | //var conservativeForeignFundsList = await yahooClient.GetConservativeForeignFundsAsync(10); 62 | //var growthTechStocksList = await yahooClient.GetGrowthTechnologyStocksAsync(10); 63 | //var highYieldBondsList = await yahooClient.GetHighYieldBondsAsync(10); 64 | //var mostShortedStocksList = await yahooClient.GetMostShortedStocksAsync(10); 65 | //var portfolioAnchorsList = await yahooClient.GetPortfolioAnchorsAsync(10); 66 | //var solidLargeGrowthFundsList = await yahooClient.GetSolidLargeGrowthFundsAsync(10); 67 | //var solidMidcapGrowthFundsList = await yahooClient.GetSolidMidcapGrowthFundsAsync(10); 68 | //var topMutualFundsList = await yahooClient.GetTopMutualFundsAsync(10); 69 | //var undervaluedGrowthStocksList = await yahooClient.GetUndervaluedGrowthStocksAsync(10); 70 | //var undervaluedLargeCapsList = await yahooClient.GetUndervaluedLargeCapStocksAsync(10); 71 | //var undervaluedWideMoatStocksList = await yahooClient.GetUndervaluedWideMoatStocksAsync(10); 72 | //var morningstarFiveStarStocksList = await yahooClient.GetMorningstarFiveStarStocksAsync(10); 73 | //var strongUndervaluedStocksList = await yahooClient.GetStrongUndervaluedStocksAsync(10); 74 | //var analystStrongBuyStocksList = await yahooClient.GetAnalystStrongBuyStocksAsync(10); 75 | //var latestAnalystUpgradedStocksList = await yahooClient.GetLatestAnalystUpgradedStocksAsync(10); 76 | //var mostInstitutionallyBoughtLargeCapStocksList = await yahooClient.GetMostInstitutionallyBoughtLargeCapStocksAsync(10); 77 | //var mostInstitutionallyHeldLargeCapStocksList = await yahooClient.GetMostInstitutionallyHeldLargeCapStocksAsync(10); 78 | //var mostInstitutionallySoldLargeCapStocksList = await yahooClient.GetMostInstitutionallySoldLargeCapStocksAsync(10); 79 | //var stocksWithMostInstitutionalBuyersList = await yahooClient.GetStocksWithMostInstitutionalBuyersAsync(10); 80 | //var stocksWithMostInstitutionalSellersList = await yahooClient.GetStocksWithMostInstitutionalSellersAsync(10); 81 | //var stocksMostBoughtByHedgeFundsList = await yahooClient.GetStocksMostBoughtByHedgeFundsAsync(10); 82 | //var stocksMostBoughtByPensionFundsList = await yahooClient.GetStocksMostBoughtByPensionFundsAsync(10); 83 | //var stocksMostBoughtByPrivateEquityList = await yahooClient.GetStocksMostBoughtByPrivateEquityAsync(10); 84 | //var stocksMostBoughtBySovereignWealthFundsList = await yahooClient.GetStocksMostBoughtBySovereignWealthFundsAsync(10); 85 | //var topStocksOwnedByCathieWoodList = await yahooClient.GetTopStocksOwnedByCathieWoodAsync(10); 86 | //var topStocksOwnedByGoldmanSachsList = await yahooClient.GetTopStocksOwnedByGoldmanSachsAsync(10); 87 | //var topStocksOwnedByWarrenBuffetList = await yahooClient.GetTopStocksOwnedByWarrenBuffetAsync(10); 88 | //var topStocksOwnedByRayDalioList = await yahooClient.GetTopStocksOwnedByRayDalioAsync(10); 89 | //var topBearishStocksRightNowList = await yahooClient.GetTopBearishStocksRightNowAsync(10); 90 | //var topBullishStocksRightNowList = await yahooClient.GetTopBullishStocksRightNowAsync(10); 91 | //var topUpsideBreakoutStocksList = await yahooClient.GetTopUpsideBreakoutStocksAsync(10); 92 | 93 | var r = await yahooClient.GetRealTimeQuotesAsync("TSLA"); 94 | Console.WriteLine($"{r?.Symbol} {r?.RegularMarketPrice} {r?.Bid} {r?.BidSize} {r?.Ask} {r?.AskSize}"); 95 | 96 | Console.WriteLine(); 97 | } 98 | catch (Exception ex) 99 | { 100 | Console.WriteLine(ex.Message); 101 | Console.WriteLine(ex.StackTrace); 102 | } 103 | 104 | Console.WriteLine(); -------------------------------------------------------------------------------- /tests/TestConsoleApp/TestConsoleApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/UnitTests/OoplesFinance.YahooFinanceAPI.Tests.Unit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | false 8 | 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | runtime; build; native; contentfiles; analyzers; buildtransitive 25 | all 26 | 27 | 28 | runtime; build; native; contentfiles; analyzers; buildtransitive 29 | all 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tests/UnitTests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; 2 | global using static OoplesFinance.YahooFinanceAPI.YahooClient; 3 | global using OoplesFinance.YahooFinanceAPI.Enums; 4 | global using FluentAssertions; --------------------------------------------------------------------------------