From 0f3638440eb4e64d078aaa6359d45971a4c88d24 Mon Sep 17 00:00:00 2001 From: arjunjain Date: Thu, 13 Aug 2026 11:51:03 +0530 Subject: [PATCH] Rename market symbol filter to market_id Sync with python-client: the /market and /market/count endpoints now take market_id instead of symbol. The old filter was removed upstream, so no alias is kept. Updates the README and both examples too. --- README.md | 2 +- examples/count_api.php | 2 +- examples/market_api.php | 4 ++-- src/Constants.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 66aac25..2a7d860 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ names are case-insensitive. See the parameter reference per endpoint. ```php -$client->get_market_news(['q' => 'apple', 'symbol' => 'AAPL']); +$client->get_market_news(['q' => 'apple', 'market_id' => 'AAPL']); $client->get_news_count([ 'from_date' => '2024-01-01', diff --git a/examples/count_api.php b/examples/count_api.php index 88af629..7faec1c 100644 --- a/examples/count_api.php +++ b/examples/count_api.php @@ -18,7 +18,7 @@ try { $news = $newsdataApiObj->get_news_count($base + ['q' => 'election']); $crypto = $newsdataApiObj->get_crypto_count($base + ['coin' => 'btc']); - $market = $newsdataApiObj->get_market_count($base + ['symbol' => 'AAPL']); + $market = $newsdataApiObj->get_market_count($base + ['market_id' => 'AAPL']); var_dump($news, $crypto, $market); } catch (NewsdataException $e) { diff --git a/examples/market_api.php b/examples/market_api.php index 8cd4803..7ab6d79 100644 --- a/examples/market_api.php +++ b/examples/market_api.php @@ -9,8 +9,8 @@ $newsdataApiObj = new NewsdataApi(NEWSDATA_API_KEY); $data = [ - 'q' => 'apple', - 'symbol' => 'AAPL', + 'q' => 'apple', + 'market_id' => 'AAPL', ]; try { diff --git a/src/Constants.php b/src/Constants.php index 845626f..a608113 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -121,7 +121,7 @@ final class Constants 'excludecountry', 'domain', 'domainurl', 'excludedomain', 'language', 'excludelanguage', 'prioritydomain', 'timezone', 'timeframe', 'size', 'full_content', 'image', 'video', 'page', 'tag', 'sentiment', - 'excludefield', 'removeduplicate', 'organization', 'symbol', 'id', 'url', + 'excludefield', 'removeduplicate', 'organization', 'market_id', 'id', 'url', 'sort', 'creator', 'datatype', 'sentiment_score', ], 'count' => [ @@ -142,7 +142,7 @@ final class Constants 'from_date', 'to_date', 'q', 'qintitle', 'qinmeta', 'country', 'excludecountry', 'domain', 'domainurl', 'excludedomain', 'language', 'excludelanguage', 'full_content', 'image', 'video', 'organization', - 'symbol', 'prioritydomain', 'page', 'sentiment', 'removeduplicate', 'size', + 'market_id', 'prioritydomain', 'page', 'sentiment', 'removeduplicate', 'size', 'sort', 'tag', 'interval', 'creator', 'datatype', 'sentiment_score', ], ];