Creating a segment with the "location circle" type

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

Request

POST

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

Body

application/json
{
    "segment": {
        "name": "string",
        "radius": 0,
        "period_length": 0,
        "times_quantity": 0,
        "points": [
            {
                "latitude": 0,
                "longitude": 0,
                "description": "string"
            }
        ],
        "geo_segment_type": "string"
    }
}

Name

Description

segment*

Type: SegmentRequestGeoCircle

The segment with the specified parameters.

SegmentRequestGeoCircle

The segment with the specified parameters.

Name

Description

name*

Type: string

Segment name.

geo_segment_type

Type: string

Coordinate type. Acceptable values:

  • last: Current location. The segment includes users who are currently in the selected area or who were in the area less than an hour ago.
  • regular: Frequent location. The segment includes 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 includes users who live in the selected area.
  • work: Work location. The segment includes users who work in the selected area.
  • condition: The condition "The user visited the specified places X times during the period". The segment includes users who meet this criteria.

period_length

Type: integer<int32>

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).

points

Type: GeoPoint[]

A list of coordinates.
The coordinates of the points.

radius

Type: integer<int32>

The coverage radius in meters.

times_quantity

Type: integer<int32>

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.

GeoPoint

The coordinates of the points.

Name

Description

description

Type: string

Any comment up to 200 characters.

Min length: 0

Max length: 200

latitude

Type: number

Latitude.

longitude

Type: number

Longitude.

Responses

200 OK

OK

Body

application/json
{
    "segment": {
        "id": 0,
        "name": "string",
        "type": "string",
        "status": "string",
        "create_time": "2022-12-29T18:02:01Z",
        "owner": "string",
        "geo_segment_type": "string",
        "times_quantity": 0,
        "period_length": 0,
        "radius": 0,
        "points": [
            {
                "latitude": 0,
                "longitude": 0,
                "description": "string"
            }
        ]
    }
}

Name

Description

segment

Type: CircleGeoSegment

Segment based on location data for circles.

CircleGeoSegment

Segment based on location data for circles.

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

geo_segment_type

Type: string

Coordinate type. Acceptable values:

  • last: Current location. The segment includes users who are currently in the selected area or who were in the area less than an hour ago.
  • regular: Frequent location. The segment includes 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 includes users who live in the selected area.
  • work: Work location. The segment includes users who work in the selected area.
  • condition: The condition "The user visited the specified places X times during the period". The segment includes users who meet this criteria.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

period_length

Type: integer<int32>

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).

points

Type: GeoPoint[]

A list of coordinates.
The coordinates of the points.

radius

Type: integer<int32>

The coverage radius in meters.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded – The segment with the user's data has been uploaded.
  • is_processed – The segment with the specified parameters is being processed.
  • processed – Uploading and processing the segment is complete. The segment is ready to use.
  • processing_failed – Processing the segment failed with an error.
  • is_updated — The segment is updated.
  • few_data – The segment doesn't have enough data.

times_quantity

Type: integer<int32>

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.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

No longer supported, please use an alternative and newer version.