Would like to clarify whether the API can return the full source name (e.g., 'FXStreet') rather than just a source code (e.g., 'FORSTR')? Also, I would like to check if news timestamps and source information (news link )can be retrieved via the API.
@hkdevelopment123
Thank you for reaching out to us.
I checked and found that the API returns the News code (NS:FORSTR).
Then, you can use the following code to get the full source name of the News code.
news_metadata_url="https://api.refinitiv.com/data/news/v1/metadata/" news_code = "NS:FORSTR" request_definition = ld.delivery.endpoint_request.Definition( url = news_metadata_url+news_code, method = ld.delivery.endpoint_request.RequestMethod.GET, ) response = request_definition.get_data() response.data.raw['newsCode']['label']
You can use the news module in the content layer to retrieve raw data.
response = news.headlines.Definition("Source:FORSTR").get_data() response.data.raw
The full example is on GitHub.