Creating a segment with the “location circle” type

Creates a segment based on location data with the “circle” type.

  1. Request syntax
  2. In the request body
  3. Response format

Request syntax

https://api-audience.yandex.ru/v1/management/segments/create_geo
 ? 

In the request body


{
    "segment" : {
        "name" :  < string > ,
        "radius" :  < integer > ,
        "period_length" :  < integer > ,
        "times_quantity" :  < integer > ,
        "points" : [ {
            "latitude" :  < big_decimal > ,
            "longitude" :  < big_decimal > ,
            "description" :  < string > 
        }, ... ],
        "geo_segment_type" :  < geo_segment_type > 
    }
}
Parameters Description
segment The segment with the specified parameters.
segment
name Segment name.
radius The coverage radius in meters.
period_length

The period for visits to the specified places. This parameter is required if you are creating the condition “The user visited the specified places X times during the period”.

Acceptable values for the time period (in days): from 1 to 90 (inclusive).

times_quantity

Frequency of visits to the specified places. This parameter is required if you are creating the condition “The user visited the specified places X times during the period”.

Note.

Only one visit per day is counted.

points List of coordinates.
geo_segment_type Type of coordinates for creating the segment.

Possible values:

  • last — Current location. The segment will include users who are located in the selected area right now, or who were there less than an hour ago.
  • regular — Frequent location. The segment will include users who frequently visit the selected area. For example, they may be people who live or work nearby. Targeting is based on the data from the past 45 days.
  • home — Home location. The segment will include users who live in the selected area.
  • work — Work location. The segment will include users who work in the selected area.
  • condition — The condition “The user visited the specified places X times during the period”. The segment will include users who meet this criteria.
points
latitude Latitude.
longitude Longitude.
description Any comment with the length not exceeding 200.
Parameters Description
segment The segment with the specified parameters.
segment
name Segment name.
radius The coverage radius in meters.
period_length

The period for visits to the specified places. This parameter is required if you are creating the condition “The user visited the specified places X times during the period”.

Acceptable values for the time period (in days): from 1 to 90 (inclusive).

times_quantity

Frequency of visits to the specified places. This parameter is required if you are creating the condition “The user visited the specified places X times during the period”.

Note.

Only one visit per day is counted.

points List of coordinates.
geo_segment_type Type of coordinates for creating the segment.

Possible values:

  • last — Current location. The segment will include users who are located in the selected area right now, or who were there less than an hour ago.
  • regular — Frequent location. The segment will include users who frequently visit the selected area. For example, they may be people who live or work nearby. Targeting is based on the data from the past 45 days.
  • home — Home location. The segment will include users who live in the selected area.
  • work — Work location. The segment will include users who work in the selected area.
  • condition — The condition “The user visited the specified places X times during the period”. The segment will include users who meet this criteria.
points
latitude Latitude.
longitude Longitude.
description Any comment with the length not exceeding 200.

Sample request

POST https://api-audience.yandex.ru/v1/management/segments/create_geo?

Response format


{
    "segment" :  < _circle_geo_segment > 
}
Parameters Description
segment The segment with the specified parameters.
Parameters Description
segment The segment with the specified parameters.