newsAPI

免费增值
通过 Strata Consulting LLC | 已更新 2 months ago | News, Media
人气

9.7 / 10

延迟

2,555ms

服务等级

100%

Health Check

N/A

返回所有讨论

What is the path for retreiving images?

Rapid account: Adam 1 Ai T 2 Js Qm
adam-1aiT2JsQm
a month ago

Hi

When fetching data the “image” variable return a value like:

“api/attachments/CC8iK0NnNUJUWFJMZWtKSGVHbFNZbFJ2VFJDb0FSaXNBaWdCTWdhVmxKUXB1Z1k”

I am guessing I need to do another request to fetch this image.

I have tried making a GET request to a few variations like:
https://newsapi90.p.rapidapi.com/api/attachments/CC8iK0NnNUJUWFJMZWtKSGVHbFNZbFJ2VFJDb0FSaXNBaWdCTWdhVmxKUXB1Z1k

Passing X-RapidAPI-host and X-RapidAPI-Key in the headers.

All I get is a 404 not found. Am I querying the correct endpoint?

Regards
Adam

Rapid account: Strataconsultingllc
strataconsultingllc Commented 16 days ago

This bug has been fixed. The image URLs that are returned by newsAPI will now look something like this: news.google.com/attachments/CC8iK0NnNVRPVWxVTFhsQlFtaHFTRjlIVFJERUF4aW5CU2dLTWdhQjBJcnlVQVU

One thing to note is that Google News recently changed the way it links to images, so this URL will end up redirecting to the actual image. in this example case, the final URL will look like this: https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSRv2VhkhJsVkv4MiJXezqlvV50w-OmiC6Qcu1coXY5hVtq14EyCx2FSvbnEUwaBfM

Google might change things in the future, but as of 5/12/2024 when this post was written, this is the most current information.

I hope this helps. Thanks!

Rapid account: Strataconsultingllc
strataconsultingllc Commented 17 days ago

Hi Adam,

Thanks for reaching out about this issue. This appears to be a bug that has recently surfaced where the URLs for the article images are not populating correctly. I will look into this issue immediately and get back to you as soon as I can.

Thanks for catching this and bringing it to my attention!

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论