Instagram Scraper avatar
Instagram Scraper

Pricing

$2.30 / 1,000 results

Go to Store
Instagram Scraper

Instagram Scraper

Developed by

Apify

Apify

Maintained by Apify

Scrape and download Instagram posts, profiles, places, hashtags, photos, and comments. Get data from Instagram using one or more Instagram URLs or search queries. Export scraped data, run the scraper via API, schedule and monitor runs or integrate with other tools.

4.4 (53)

Pricing

$2.30 / 1,000 results

1399

Total users

91.4k

Monthly users

10.1k

Runs succeeded

>99%

Response time

2.7 days

Last modified

17 hours ago

MT

Instagram assets expire after approximately 24 hours

Closed

mattblode opened this issue
a year ago

When I do a scrape, I want to display the assets on the front-end of my mini website platform as a social feed. I'm proxying the images via a Cloudflare worker, however, I have found that the assets expire after approximately 24 hours. Is there a way to bypass this restriction with serving Instagram assets? The only options I have are to scrape every 24 hours or to scrape once per week (for example) and upload the assets to S3 and serve them from there. Does anyone have experience working around this issue?

alexey avatar

Hi! Its known anti-hotlinking protection applied by Meta all media URLs, they expire exactly to not allow reusing direct URLs by somebody else. You need to download media URLs ASAP and then host in your own CDN by another actor: https://apify.com/lukaskrivka/images-download-upload Please try sample input optimized for downloading IG results:

{
"convertWebpToPng": false,
"datasetId": "kya3nQTKUtFYNVhrk",
"fileNameFunction": "({ url }) => new URL(url).pathname.split(\"/\").pop()",
"imageCheckType": "content-type",
"noDownloadRun": false,
"pathToImageUrls": "images",
"preDownloadFunction": "({ data }) => data.map((item) => {\r\n if (!item.images?.length) {\r\n item.images = [item.displayUrl];\r\n }\r\n return item;\r\n})",
"proxyConfiguration": {
"useApifyProxy": true
},
"s3CheckIfAlreadyThere": false,
"uploadTo": "zip-file"
}

You can also ask community in Apify Discord #hire-freelancers to build a simple integration script for this.

I´m going to close the issue now, but if there would be anything else we could help with, please let us know.