Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Getting data through API 2.0 using mutiple breakdowns for many metrics

Avatar

Level 1

Hello everyone,

 

I would like to import some data to my jupyter notebook (python) using API and aanalytics2 package. In general the structure of the report that I would like to get has the structure as following:

  1. All visits
    • Product Group 1
      • Week 1
      • Week 2
    • Product Group 2
      • Week 1
      • Week 2
    • Product Group 3
      • Week 1
      • Week 2

The problem that I have is that when I am using a debugger to get the JSON code it only includes the last product group divided into weeks.

 

It looks like this:

  • Week 1 - some data
  • Week 2 - some data

Is there any way to generate a JSON that would include all of the product groups divided into different weeks?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @hstk have you tried building out this report (with the formatting) in Workspace? There is a trick that you may or many not know about....

 

Under the help menu, you can enable Debugging....  this will show a new icon on each visualization that will show timestamps of all the API calls used to build the data, each of these is clickable and will take you to a page that shows you the API call in multiple formats.

This can be a great way to start with a base API call that you can tweak afterwards. But since I know you can build the format you mentioned in Workspace, these debug API calls should allow you to replicate the data format as you would like to see it.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @hstk have you tried building out this report (with the formatting) in Workspace? There is a trick that you may or many not know about....

 

Under the help menu, you can enable Debugging....  this will show a new icon on each visualization that will show timestamps of all the API calls used to build the data, each of these is clickable and will take you to a page that shows you the API call in multiple formats.

This can be a great way to start with a base API call that you can tweak afterwards. But since I know you can build the format you mentioned in Workspace, these debug API calls should allow you to replicate the data format as you would like to see it.