skip to Main Content

Facebook api – How to retrieve insights API for ad in day-granularity on Facebook?

How to retrieve the insights data in day-granularity from Facebook API. This is the request I use:   1234548/insights?fields=ad_id,impressions,account_id,created_time,adset_id,campaign_id,clicks,conversions&time_range={'since':'2023-01-01','until':'2023-05-20'} The response:   "data": [     {       "ad_id": "xxxxxxxx",       "impressions": "54367",       "account_id": "xxxxxxxx",       "created_time": "2023-05-17",       "adset_id": "xxxxxxxxxxx",       "campaign_id": "xxxxxxxxxx",       "clicks": "853",       "date_start":…

VIEW QUESTION

How to parse part. stringified JSON from external API in Node.js?

I'm working with an external API in Node.js and receiving a JSON object that appears to be partially stringified. Here is a sample of what I'm getting: {"2":["{"1":{"3":{"1":0,"3":{"1":[{"1":27,"2":{"2":"Some data is not available"}}]}},"4":"3168034526981006837"},"2":{"1":[{"1":"Brand1","2":1,"3":["2400","1900","1900","2900","2400","2900","3600","2900","2900","2900","3600","2900"],"6":"0","200":{"1":["2900","0.0","0.20833333333333334","0.0","316003","616827","0.0"]}},{"1":"Brand2","2":1,"3":["246000","165000","201000","246000","246000","301000","301000","301000","301000","246000","301000","301000"],"6":"0","200":{"1":["246000","0.22357723577235772","0.22357723577235772","0.0","","","0.22357723577235772"]}},{"1":"Brand3","2":1,"3":["6600","5400","6600","8100","8100","9900","12100","8100","8100","8100","9900","6600"],"6":"0","200":{"1":["8100","-0.18518518518518517","-0.18518518518518517","0.0","629943","2000000","-0.18518518518518517"]}}],"2":{"2":[{"3":"metric4"},{"3":"metric1"},{"3":"metric2"},{"3":"metric3"},{"3":"bid_min"},{"3":"metric5"},{"3":"metric6"}]},"3":{"1":{"1":"3"}}}}","{"1":{"3":{"1":0,"3":{"1":[{"1":27,"2":{"2":"Some data may be not available"}}]}},"4":"3168034526981006837"},"2":{"2":[{"1":"255000","2":{"1":2022,"2":5},"3":"235938"},{"1":"172300","2":{"1":2022,"2":6},"3":"159533"},{"1":"209500","2":{"1":2022,"2":7},"3":"193668"},{"1":"257000","2":{"1":2022,"2":8},"3":"236771"},{"1":"256500","2":{"1":2022,"2":9},"3":"237411"},{"1":"313800","2":{"1":2022,"2":10},"3":"291502"},{"1":"316700","2":{"1":2022,"2":11},"3":"291567"},{"1":"312000","2":{"1":2022,"2":12},"3":"289137"},{"1":"312000","2":{"1":2023,"2":1},"3":"289713"},{"1":"257000","2":{"1":2023,"2":2},"3":"237667"},{"1":"314500","2":{"1":2023,"2":3},"3":"289775"},{"1":"310500","2":{"1":2023,"2":4},"3":"287316"}],"6":"257000"}}"]} As seen above,…

VIEW QUESTION

Laravel 8 Jobs/Queues and API

My task is to develop a eCommerce shop with Laravel 8. I have implemented the product retrieving part as a job and in the controller I have dispatch. Idea is to improve efficiency and support concurrent users and handle parallel…

VIEW QUESTION
Back To Top
Search