1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Extracting Facebook post data - is it possible to define a date range?

Discussion in 'Facebook API' started by Johnny51, Sep 20, 2016.

  1. #1
    Hi all,

    I want to extract date from the Facebook API, specifically link clicks from page posts:
    SEMrush
    This query gives me the most recent 100 posts -
    https://graph.facebook.com/v2.5/<pageid>/posts?fields=insights.metric(post_consumptions_by_type_unique),link&limit=100

    However, when I try to define a date range, I still only get the most recent posts -
    https://graph.facebook.com/v2.5/<pageid>/posts?fields=insights.metric(post_consumptions_by_type_unique),link&limit=100?since={date.addMonths(-2).startOfMonth.format()}&until={date.today}

    First - is it even possible to make such a query or is there a restriction on this type of query.
    Second - any suggestions as to how to extract this data, so I can make 7, 30, or longer day comparisons.
    best,
    John.
     
    Johnny51, Sep 20, 2016 IP
    SEMrush
  2. dinesha4n

    dinesha4n Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #2
    Some times it is not possible to do such type of things in a manner of working
     
    dinesha4n, Sep 22, 2016 IP
  3. Apollo116

    Apollo116 Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Yes actually you can. Instead of using "post" use the "message" handle after the userid. You should then add the handle _timecreated_. It will then let you scroll through a list of time created message events. Of course you would need an access token. Hope this works for you.
     
    Apollo116, Sep 22, 2016 IP