newsAPI

부분 유료
분류별 Strata Consulting LLC | 업데이트됨 2ヶ月前 | News, Media
인기

9.7 / 10

지연 시간

1,259ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

What is the path for retreiving images?

Rapid account: Adam 1 Ai T 2 Js Qm
adam-1aiT2JsQm
1ヶ月前

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 1ヶ月前

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 1ヶ月前

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!

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입