# Filter users by custom attribute

You can return users based on their custom attributes.

GET /users/search/?custom_attr__gte=:10

Attributes Type Required Description
custom_attr string yes A name of your custom attribute.
Lookups Works with Description
__lt integer less than
__lte integer less than or equal
__gt integer greater than
__gte integer greater than or equal
__startswith string value of given attribute starts with (case sensitive)
__istartswith string value of given attribute starts with (case insensitive)
__endswith string value of given attribute ends with (case sensitive)
__iendswith string value of given attribute ends with (case insensitive)
__contains string value of given attribute contains string (case insensitive)
__icontains string value of given attribute contains string (case insensitive)

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
"https://<your_app_subdomain>.user.com/api/public/users/search/?custom_attr__gte=10"

# Response

{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 41762938,
            "key": "KSkZrYtUZ0PW",
            "name": John,
            "email": Doe,
            "gender": "unknown",
            "status": "vistor",
            "phone_number": null,
            "first_seen": "2017-09-22T12:08:28.490534Z",
            "last_seen": "2017-09-22T12:08:28.500483Z",
            "page_views": 1,
            "last_ip": "213.216.69.162",
            "timezone": "Europe/Kaliningrad",
            "city": null,
            "region": null,
            "country": "Poland",
            "unsubscribed": false,
            "browser_language": "pl",
            "score": 0,
            "browser": "Opera",
            "os_type": "Linux",
            "resolution": "1920x1080",
            "created_at": "2017-09-22T12:08:28.502834Z",
            "updated_at": "2017-09-25T13:10:34.616559Z",
            "attributes": [
                {
                    "name_std": "ordered_items",
                    "name": "ordered_items",
                    "value": 11,
                    "id": 248806
                }
            ],
            "gravatar_url": null,
            "lists": [],
            "tags": [],
            "notifications": true,
            "facebook_url": null,
            "linkedin_url": null,
            "twitter_url": null,
            "google_url": null,
            "chat_id": "Chat ID is deprecated and will be removed in future",
            "last_contacted": null,
            "user_id": null
        },
        {
            "id": 41757460,
            "key": "4oiw2fRWyVSs",
            "name": Jane,
            "email": Doe,
            "gender": "unknown",
            "status": "vistor",
            "phone_number": null,
            "first_seen": "2017-09-22T11:41:25.312941Z",
            "last_seen": "2017-09-22T11:41:25.331167Z",
            "page_views": 1,
            "last_ip": "213.216.69.162",
            "timezone": "Europe/Kaliningrad",
            "city": null,
            "region": null,
            "country": "Poland",
            "unsubscribed": false,
            "browser_language": "pl",
            "score": 0,
            "browser": "Opera",
            "os_type": "Linux",
            "resolution": "1920x1080",
            "created_at": "2017-09-22T11:41:25.334508Z",
            "updated_at": "2017-09-25T13:10:49.155165Z",
            "attributes": [
                {
                    "name_std": "ordered_items",
                    "name": "ordered_items",
                    "value": 17,
                    "id": 248806
                }
            ],
            "gravatar_url": null,
            "lists": [],
            "tags": [],
            "notifications": true,
            "facebook_url": null,
            "linkedin_url": null,
            "twitter_url": null,
            "google_url": null,
            "chat_id": "Chat ID is deprecated and will be removed in future",
            "last_contacted": null,
            "user_id": null
        },
        {
            "id": 41742710,
            "key": "SvepkkkqXykw",
            "name": John Junior,
            "email": Doe,
            "gender": "unknown",
            "status": "vistor",
            "phone_number": null,
            "first_seen": "2017-09-22T10:31:39.473347Z",
            "last_seen": "2017-09-22T10:31:39.495327Z",
            "page_views": 1,
            "last_ip": "213.216.69.162",
            "timezone": "Europe/Kaliningrad",
            "city": null,
            "region": null,
            "country": "Poland",
            "unsubscribed": false,
            "browser_language": "pl",
            "score": 0,
            "browser": "Opera",
            "os_type": "Linux",
            "resolution": "1920x1080",
            "created_at": "2017-09-22T10:31:39.498994Z",
            "updated_at": "2017-09-25T13:10:59.566249Z",
            "attributes": [
                {
                    "name_std": "ordered_items",
                    "name": "ordered_items",
                    "value": 10,
                    "id": 248806
                }
            ],
            "gravatar_url": null,
            "lists": [],
            "tags": [],
            "notifications": true,
            "facebook_url": null,
            "linkedin_url": null,
            "twitter_url": null,
            "google_url": null,
            "chat_id": "Chat ID is deprecated and will be removed in future",
            "last_contacted": null,
            "user_id": null
        }
    ]
}