Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Transform Facebook Graph API insights JSON to pandas dataframe
I am trying to read my Page INSIGHTS from Facebook graph API and then convert into pandas dataframe but unable to do so.

I used json_normalize function but i did not help me

Here is my JSON
[{'name': 'page_impressions',
      'period': 'day',
      'values': [{'value': 0, 'end_time': '2020-01-02T08:00:00+0000'},
       {'value': 0, 'end_time': '2020-01-03T08:00:00+0000'},
       {'value': 0, 'end_time': '2020-01-04T08:00:00+0000'},
       {'value': 0, 'end_time': '2020-01-05T08:00:00+0000'},
      'title': 'Daily Total Impressions',
      'description': "Daily: The number of times any content from your Page or about your Page entered a person's screen. This includes posts, stories, check-ins, ads, social information from people who interact with your Page and more. (Total Count)",
      'id': '761993803915367/insights/page_impressions/day'},
     {'name': 'page_fans',
      'period': 'day',
      'values': [{'value': 587, 'end_time': '2020-01-02T08:00:00+0000'},
       {'value': 587, 'end_time': '2020-01-03T08:00:00+0000'},
       {'value': 587, 'end_time': '2020-01-04T08:00:00+0000'},
       {'value': 587, 'end_time': '2020-01-05T08:00:00+0000'}],

      'title': 'Lifetime Total Likes',
      'description': 'Lifetime: The total number of people who have liked your Page. (Unique Users)',
      'id': '761993803915367/insights/page_fans/day'}]
Sample Expected Output in dataframe
page_impressions | page_fans | end_time 0 587 2020-01-03T08:00:00+0000
Larz60+ wrote Mar-03-2020, 09:01 AM:
Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.

Note that python tags work well for jason content

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Difference of two columns in Pandas dataframe zinho 0 55 Jun-01-2020, 01:11 PM
Last Post: zinho
  error bars with dataframe and pandas Hucky 4 288 Apr-27-2020, 02:02 AM
Last Post: Hucky
  Read json array data by pandas vipinct 0 146 Apr-13-2020, 02:24 PM
Last Post: vipinct
  Python Pandas DataFrame Help AmericanEagle1989 1 187 Apr-12-2020, 12:37 PM
Last Post: AmericanEagle1989
  How does pyplot know what was plotted by the output of pandas.DataFrame(...).cumprod( codeowl 2 200 Mar-28-2020, 08:27 AM
Last Post: j.crater
  Ordering of pandas DataFrame new_to_python 5 272 Mar-15-2020, 06:08 PM
Last Post: new_to_python
  Pandas dataframe merge snmmat 1 262 Mar-09-2020, 06:56 PM
Last Post: jefsummers
  JSON to Dataframe DrX 1 257 Feb-19-2020, 07:58 PM
Last Post: DrX
  Obtaining Correct Date In Pandas DataFrame eddywinch82 14 1,405 Feb-17-2020, 11:45 AM
Last Post: eddywinch82
  Parse XML String in Pandas Dataframe creedX 2 958 Dec-09-2019, 07:35 PM
Last Post: creedX

Forum Jump:

Users browsing this thread: 1 Guest(s)