Creating a segment with the "lookalike" type

Creates a lookalike segment with the specified parameters.

Request

POST

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

Body

application/json
{
  "segment": {
    "name": "example",
    "lookalike_link": 0,
    "lookalike_value": 1,
    "maintain_device_distribution": true,
    "maintain_geo_distribution": true
  }
}

Name

Description

segment

Type: SegmentRequestLookalike

The segment with the specified parameters.

Example
{
  "name": "example",
  "lookalike_link": 0,
  "lookalike_value": 1,
  "maintain_device_distribution": true,
  "maintain_geo_distribution": true
}

SegmentRequestLookalike

The segment with the specified parameters.

Name

Description

lookalike_link

Type: integer

ID of the segment that the created segment should be similar to.

lookalike_value

Type: integer

The degree of similarity. Accepts the values 1, 2, 3, 4, and 5.

Min value: 1

Max value: 5

name

Type: string

Segment name.

Example: example

maintain_device_distribution

Type: boolean

Distribute users by device type. Acceptable values:

  • true: The distribution of users by device type is maintained, if possible.
  • false: The distribution of users by device type is ignored.

Default value: true.

maintain_geo_distribution

Type: boolean

Distribute users by city. Acceptable values:

  • true: The distribution of users by city is maintained, if possible.
  • false: The distribution of users by city is ignored.

Default value: true.

Example
{
  "name": "example",
  "lookalike_link": 0,
  "lookalike_value": 1,
  "maintain_device_distribution": true,
  "maintain_geo_distribution": true
}

Responses

200 OK

OK

Body

application/json
{
  "segment": {
    "type": "example",
    "id": 0,
    "name": "example",
    "status": "example",
    "create_time": "2025-01-01T00:00:00Z",
    "owner": "example",
    "has_guests": true,
    "guest_quantity": 0,
    "can_create_dependent": true,
    "has_derivatives": true,
    "derivatives": [
      0
    ],
    "cookies_matched_quantity": 0,
    "lookalike_link": 0,
    "lookalike_value": 0,
    "maintain_device_distribution": true,
    "maintain_geo_distribution": true
  }
}

Name

Description

segment

Type: LookalikeSegment

A segment of users who are similar to one of the client's other segments (look-alike technology).

Example
{
  "type": "example",
  "id": 0,
  "name": "example",
  "status": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "owner": "example",
  "has_guests": true,
  "guest_quantity": 0,
  "can_create_dependent": true,
  "has_derivatives": true,
  "derivatives": [
    0
  ],
  "cookies_matched_quantity": 0,
  "lookalike_link": 0,
  "lookalike_value": 0,
  "maintain_device_distribution": true,
  "maintain_geo_distribution": true
}

BaseSegment

The segment description by type.

Name

Description

name

Type: string

Segment name.

Example: example

create_time

Type: string<date-time>

The time of segment creation.

Example: 2025-01-01T00:00:00Z

id

Type: integer

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

owner

Type: string

The username of the segment owner.

Example: example

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: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

Example: example

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.

Example: example

Example
{
  "type": "example",
  "id": 0,
  "name": "example",
  "status": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "owner": "example"
}

LookalikeSegment

A segment of users who are similar to one of the client's other segments (look-alike technology).

All of 2 types
  • Type: BaseSegment

    The segment description by type.

    Example
    {
      "type": "example",
      "id": 0,
      "name": "example",
      "status": "example",
      "create_time": "2025-01-01T00:00:00Z",
      "owner": "example",
      "has_guests": true,
      "guest_quantity": 0,
      "can_create_dependent": true,
      "has_derivatives": true,
      "derivatives": [
        0
      ],
      "cookies_matched_quantity": 0
    }
    
  • Type: object

    lookalike_link

    Type: integer

    ID of the segment that the created segment should be similar to.

    lookalike_value

    Type: integer

    The degree of similarity. Accepts the values 1, 2, 3, 4, and 5.

    maintain_device_distribution

    Type: boolean

    Distribute users by device type. Acceptable values:

    • true: The distribution of users by device type is maintained, if possible.
    • false: The distribution of users by device type is ignored.

    Default value: true.

    maintain_geo_distribution

    Type: boolean

    Distribute users by city. Acceptable values:

    • true: The distribution of users by city is maintained, if possible.
    • false: The distribution of users by city is ignored.

    Default value: true.

    Example
    {
      "lookalike_link": 0,
      "lookalike_value": 0,
      "maintain_device_distribution": true,
      "maintain_geo_distribution": true
    }
    
Example
{
  "type": "example",
  "id": 0,
  "name": "example",
  "status": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "owner": "example",
  "has_guests": true,
  "guest_quantity": 0,
  "can_create_dependent": true,
  "has_derivatives": true,
  "derivatives": [
    0
  ],
  "cookies_matched_quantity": 0,
  "lookalike_link": 0,
  "lookalike_value": 0,
  "maintain_device_distribution": true,
  "maintain_geo_distribution": true
}

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