Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions EODHistoricalData.Wrapper/API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,19 +430,33 @@ public async Task<User> GetUserDataAsync()
/// There are no limitations to a minimum number of symbols in the query string</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
public async Task<List<SearchResult>> GetSearchResultAsync(string searchString)
public async Task<List<SearchExtendedResult>> GetSearchExtendedResultAsync(string searchString)
{
if (searchString == string.Empty) throw new ArgumentNullException(nameof(searchString));

return await searchAPI.GetQuerySearchExtendedAsync(searchString);
}

/// <summary>
/// Search API for Stocks, ETFs, Mutual Funds, and Indices
/// </summary>
/// <param name="searchString">String. REQUIRED. Could be any string with a ticker code or company name.
/// Examples: ‘AAPL’, ‘Apple Inc’, ‘Apple’. You can also use ISINs for the search: US0378331005.
/// There are no limitations to a minimum number of symbols in the query string</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
public async Task<List<SearchResult>> GetSearchResultAsync(string searchString)
{
if (searchString == string.Empty) throw new ArgumentNullException(nameof(searchString));

return await searchAPI.GetQuerySearchAsync(searchString);
}

/// <summary>
/// Get live stock prices data
/// </summary>
/// <param name="ticker">consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}, then you can use,
/// for example, AAPL.MX for Mexican Stock Exchange. Or AAPL.US for NASDAQ.</param>
/// <param name="tickers">to get data for multiple tickers at one request</param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public async Task<LiveStockPrice> GetLiveStockPricesAsync(string ticker)
Expand Down
3 changes: 2 additions & 1 deletion EODHistoricalData.Wrapper/APIs/Abstract/ISearchAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace EOD.APIs.Abstract
/// </summary>
internal interface ISearchAPI
{
Task<List<SearchResult>> GetQuerySearchExtendedAsync(string searchString);
Task<List<SearchExtendedResult>> GetQuerySearchExtendedAsync(string searchString);
Task<List<SearchResult>> GetQuerySearchAsync(string searchString);

}
}
1 change: 1 addition & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/ISentimentsAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal interface ISentimentsAPI
/// <param name="symbols">[REQUIRED]</param>
/// <param name="from">[OPTIONAL]</param>
/// <param name="to">[OPTIONAL]</param>
/// <param name="tweets">[OPTIONAL]</param>
/// <returns></returns>
Task<Dictionary<string,List<SentimentsData>>> GetSentimentsAsync(List<string> symbols, DateTime? from = null, DateTime? to = null, bool? tweets = null);
}
Expand Down
9 changes: 8 additions & 1 deletion EODHistoricalData.Wrapper/APIs/SearchAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ namespace EOD.APIs
internal class SearchAPI : BaseAPI, ISearchAPI
{
private const string sourceQuerySearchExtended = @"https://eodhistoricaldata.com/api/query-search-extended/?q={0}";
private const string sourceQuerySearch = @"https://eodhistoricaldata.com/api/search/{0}";
public SearchAPI(string apiToken, System.Net.IWebProxy proxy, string source) : base(apiToken, proxy, source) { }
public async Task<List<SearchResult>> GetQuerySearchExtendedAsync(string searchString)
public async Task<List<SearchExtendedResult>> GetQuerySearchExtendedAsync(string searchString)
{
string uri = string.Format(sourceQuerySearchExtended, searchString);
return await ExecuteQueryAsync<List<SearchExtendedResult>>(uri);
}

public async Task<List<SearchResult>> GetQuerySearchAsync(string searchString)
{
string uri = string.Format(sourceQuerySearch, searchString);
return await ExecuteQueryAsync<List<SearchResult>>(uri);
}

Expand Down
22 changes: 22 additions & 0 deletions EODHistoricalData.Wrapper/Model/SearchExtendedResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace EOD.Model
{
/// <summary>
///
/// </summary>
public class SearchExtendedResult
{
/// <summary>
///
/// </summary>
public string Code { get; set; }
/// <summary>
///
/// </summary>
public string Exchange { get; set; }
/// <summary>
///
/// </summary>
public string Name { get; set; }

}
}
33 changes: 32 additions & 1 deletion EODHistoricalData.Wrapper/Model/SearchResult.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
namespace EOD.Model
using System;

namespace EOD.Model
{
/// <summary>
///
/// </summary>
public class SearchResult
{
//"isPrimary":true,"previousClose":22.35,"previousCloseDate":"2026-02-26"}
/// <summary>
///
/// </summary>
Expand All @@ -17,6 +20,34 @@ public class SearchResult
///
/// </summary>
public string Name { get; set; }
/// <summary>
///
/// </summary>
public string Type { get; set; }
/// <summary>
///
/// </summary>
public string Country { get; set; }
/// <summary>
///
/// </summary>
public string Currency { get; set; }
/// <summary>
///
/// </summary>
public string Isin { get; set; }
/// <summary>
///
/// </summary>
public bool IsPrimary { get; set; }
/// <summary>
///
/// </summary>
public decimal PreviousClose { get; set; }
/// <summary>
///
/// </summary>
public DateTime PreviousCloseDate { get; set; }

}
}