File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -106,4 +106,18 @@ public function yahoo($symbol, $params = [])
106106 $ this ->setParams (null , $ params );
107107 return $ this ;
108108 }
109+
110+ /**
111+ * Search API for Stocks, ETFs, Mutual Funds and Indices
112+ * url: https://eodhistoricaldata.com/financial-apis/search-api-for-stocks-etfs-mutual-funds-and-indices/
113+ * @param string $symbol
114+ * @param array $params
115+ * @return Stock
116+ */
117+ public function search ($ symbol , $ params = [])
118+ {
119+ $ this ->urlSegment = '/search ' ;
120+ $ this ->setParams ($ symbol , $ params );
121+ return $ this ;
122+ }
109123}
Original file line number Diff line number Diff line change @@ -49,4 +49,17 @@ public function test_yahoo_api()
4949 $ content = $ this ->stock ->yahoo ('AAPL.US ' )->json ();
5050 $ this ->assertNotEmpty ($ content );
5151 }
52+
53+ public function test_search_api ()
54+ {
55+ $ content = $ this ->stock ->search ('AAPL.US ' )->json ();
56+ $ this ->assertNotEmpty ($ content );
57+ }
58+
59+ public function test_search_api_filters_exchange ()
60+ {
61+
62+ $ content = $ this ->stock ->search ('AAPL.US ' , ['exchange ' =>'NASDAQ ' ])->json ();
63+ $ this ->assertNotEmpty ($ content );
64+ }
5265}
You can’t perform that action at this time.
0 commit comments