Skip to main content

Hello everyone!

I need help with a problem I’m having with the API.

When I consume the event segmentation endpoint, I get the requested grouping as long as I filter dates from approximately 3 months ago. What could I be doing wrong?.

 

Here are the parameteres im using :

params = {
"e" : '{"event_type":"_all","group_by": " { "type": "event", "value": "host"}]}',
"i" : "30",
"m" : "uniques",
"start": "20230101",
"end": "20230130",
"limit": "5"
}
base_url = "https://amplitude.com/api/2/events/segmentation"

Response example with old date request :

  "data": {
"series": "

194
],

886
],

786
],

785
],

671
]
],
"seriesCollapsed": "

{
"setId": "",
"value": 194
}
],

{
"setId": "",
"value": 886
}
],

{
"setId": "",
"value": 786
}
],

{
"setId": "",
"value": 785
}
],

{
"setId": "",
"value": 671
}
]
],
"seriesLabels": "

0,
"(none)"
],

0,
"company1"
],

0,
"company2"
],

0,
"company3"
],

0,
"company4"
]
],
"xValues": "
"2023-01-01"
]
}

And the example with “recent” dates:


"data": {
"series": r
>
4466
]
],
"seriesCollapsed": p
>
{
"setId": "",
"value": 4466
}
]
],
"seriesLabels": b
>
0,
"(none)"
]
],
"xValues": l
"2023-09-01"
]
}

Thank you very much and best regards!

HI @ljrm 

What do the chart results look like in the UI when you replicate those 2 API calls ?


UI result for one of the example results
 

Hi @Saish Redkar!, thanks for the quick response. 

Previously I checked that in the interface the hosts did have results, there is a sample for a grouping value. However, in the query I do not get any value for the grouping.


Reply