Instagram Scraper avatar

Instagram Scraper

Try for free

Pay $2.30 for 1,000 results

View all Actors
Instagram Scraper

Instagram Scraper

apify/instagram-scraper
Try for free

Pay $2.30 for 1,000 results

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.

Do you want to learn more about this Actor?

Get a demo
L7

onlyPostsForLastValue is not returning the results from last day(yesterday)

Closed

Lingbot_7 opened this issue
a month ago

Hi, I am running the Instagram scraper and passing this input. However, I noticed that it scraped data from a random day instead of just from yesterday: "onlyPostsForLastTimeUnit": "days", "onlyPostsForLastValue": 1

jakubkonecny avatar

Hello, thank you for your feedback. On further inspection, could you please link us the run where this happened so we can investigate futher?

It is possible that the posts that were outside of the time range were pinned posts, which don't apply the time filters. You can figure out if a post has been pinned by the isPinned field on each item.

L7

Lingbot_7

25 days ago

there are so many in my account, but you can refer to this one. This was run on 2024-09-17 17:40 with this input: { .... "enhanceUserSearchWithFacebookPage": false, "isUserReelFeedURL": false, "isUserTaggedFeedURL": false, "onlyPostsForLastTimeUnit": "days", "onlyPostsForLastValue": 1, "resultsType": "posts", "searchType": "hashtag" }

In the output of this run you can see so many old posts as you can see in the picture as well.

https://console.apify.com/organization/3GJggKawfAiNAa6HR/actors/runs/DqSCDk8VhTWnbkyMk#input

jakubkonecny avatar

Hello, that is most likely caused by the pinned posts being included. You can add "skipPinnedPosts": true to your input to skip over them, if you wish.

L7

Lingbot_7

25 days ago

thats not only about pinnedposts some of them don't have any pinned post but still can see old posts in output, are you sure if I will pass this input: "onlyPostsForLastTimeUnit": "days", "onlyPostsForLastValue": 1, It will fetch the record only from yesterday?

jakubkonecny avatar

Hello, thank you a lot for your patience. I have investigated the issue some more, and when I try running the exact same input as you provided in your run, but with the skipPinnedPosts added, there is not a single item that would be older than one day.

But when that field is not added, it scrapes the posts with the specific time range, and adds the pinnedPosts on top, which do not go through the same time filter.

L7

Lingbot_7

17 days ago

Ok thank you so if I would be adding this: "onlyPostsForLastTimeUnit": "days", "onlyPostsForLastValue": 1 with skipPinnedPosts. It will only scrape posts of yesterday right?

jakubkonecny avatar

Yes, that is correct.

Developer
Maintained by Apify
Actor metrics
  • 5.5k monthly users
  • 395 stars
  • 99.7% runs succeeded
  • 2 days response time
  • Created in Apr 2019
  • Modified 4 days ago