A market digest stores the headline, the source, and the symbols once the leading dollar sign is removed.
The documented example is the wider feed. Each article lists its symbols with a leading dollar sign.
To access this endpoint, you must obtain an API key: Get your API key
Leave the ticker off the request
type ALL selects the all-stocks feed when the ticker is omitted. The path stays the same when a ticker is added on a later call.
Strip the dollar sign from each symbol
The digest keeps the headline, the source, and the symbols. The row's type is the article label, separate from the query type. The excerpt is the first article in the example file.
{
"meta": {
"total": 50
},
"body": [
{
"title": "Rite Aid to close 53 more stores across 9 states amid bankruptcy proceedings",
"source": "New York Post",
"type": "Article",
"tickers": [
"$RADCQ"
]
}
]
}
import requests
url = "https://api.mboum.com/v2/markets/news"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {"type": "ALL"}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
payload = response.json()
print(payload["meta"]["total"])
for item in payload.get("body", [])[:5]:
names = [ticker.lstrip("$") for ticker in item.get("tickers", [])]
print(item["title"], item["source"], ", ".join(names))
One company needs its own call
Send ticker when the digest should cover one company. The docs example ticker is AAPL. The company call is selected by the ticker alone, so put the feed type on a request that omits the ticker.
Learn more or explore other endpoints: Mboum v2 news