Download an ad media file
Stream an ad's actual video or image bytes, using a url taken from an asset returned by /ad-media. Only Google's own ad-serving hosts are accepted. HTTP Range requests are supported, so video seeking works in a player. This is a GET with query parameters, not a JSON POST, and it bills as one request. Use it rather than the raw Google URL for video: the raw URL is signed and expires.
/media Media https://api.fetchlayer.dev/google-ad-library/media Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
url string required Media URL as returned on an ad asset. Passed as a query parameter. Only Google ad-serving hosts are accepted.
filename string optional Content-Disposition filename to serve the file as (max 200 characters).
Range string optional Standard HTTP Range request header, for example bytes=0-65535. Sent as a header, not a query parameter.
Response Fields
media
Download an ad media file
(body) binary The file itself. 200 for the whole file, 206 for a requested byte range.
Content-Type header Media type of the file, e.g. video/mp4 or image/jpeg.
Content-Range header Byte range served, on a 206 response.
Accept-Ranges header Present when the file supports range requests.
Request
curl -X GET "https://api.fetchlayer.dev/google-ad-library/media?url=https%3A%2F%2Ftpc.googlesyndication.com%2F...&filename=nike-ad.mp4" \
-H "Authorization: Bearer ss-your-key"Response
{
"note": "Binary file streamed back with Content-Type, Content-Length and Accept-Ranges headers. 404 if the file is no longer available at that URL."
}