Get Users Owned Lists
GET
/
2
/
users
/
{id}
/
owned_lists
Get Users Owned Lists
curl --request GET \
--url https://api.x.com/2/users/{id}/owned_lists \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.x.com/2/users/{id}/owned_lists"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.x.com/2/users/{id}/owned_lists', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/users/{id}/owned_lists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/users/{id}/owned_lists"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.x.com/2/users/{id}/owned_lists")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/users/{id}/owned_lists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"created_at": "<string>",
"description": "<string>",
"follower_count": 123,
"id": "<string>",
"member_count": 123,
"name": "<string>",
"owner_id": "<string>",
"private": true
}
],
"errors": [
{
"detail": "<string>",
"resource_type": "<string>",
"title": "<string>",
"type": "https://api.x.com/2/problems/resource-not-found",
"parameter": "<string>",
"resource_id": "<string>",
"status": 123,
"value": "<string>"
}
],
"includes": {
"media": [
{
"alt_text": "<string>",
"duration_ms": 123,
"height": 123,
"media_key": "<string>",
"non_public_metrics": {
"playback_0_count": 123,
"playback_100_count": 123,
"playback_25_count": 123,
"playback_50_count": 123,
"playback_75_count": 123
},
"organic_metrics": {
"playback_0_count": 123,
"playback_100_count": 123,
"playback_25_count": 123,
"playback_50_count": 123,
"playback_75_count": 123,
"view_count": 123
},
"preview_image_url": "<string>",
"promoted_metrics": {
"playback_0_count": 123,
"playback_100_count": 123,
"playback_25_count": 123,
"playback_50_count": 123,
"playback_75_count": 123,
"view_count": 123
},
"public_metrics": {
"view_count": 123
},
"type": "<string>",
"url": "<string>",
"variants": [
{
"bit_rate": 123,
"content_type": "<string>",
"url": "<string>"
}
],
"width": 123
}
],
"places": [
{
"contained_within": [
"<string>"
],
"country": "<string>",
"country_code": "<string>",
"full_name": "<string>",
"geo": {
"bbox": [
123
],
"properties": {},
"type": "Feature"
},
"id": "<string>",
"name": "<string>",
"place_type": "<string>"
}
],
"polls": [
{
"duration_minutes": 123,
"end_datetime": "<string>",
"id": "<string>",
"options": [
{
"label": "<string>",
"position": 123,
"votes": 123
}
],
"voting_status": "<string>"
}
],
"posts": [
{
"article": {},
"article_title": {},
"attachments": {
"media_keys": [
"<string>"
],
"media_source_tweet_id": [
"<string>"
],
"poll_ids": [
"<string>"
]
},
"author_id": "<string>",
"card_uri": "<string>",
"community_id": "<string>",
"context_annotations": [
{
"domain": {
"description": "<string>",
"id": "<string>",
"name": "<string>"
},
"entity": {
"description": "<string>",
"id": "<string>",
"name": "<string>"
}
}
],
"conversation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"display_text_range": [
123
],
"edit_controls": {
"editable_until": "<string>",
"edits_remaining": 123,
"is_edit_eligible": true
},
"edit_history_post_ids": [
"<string>"
],
"entities": {
"cashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"hashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"mentions": [
{
"end": 123,
"start": 123,
"id": "<string>",
"username": "<string>"
}
],
"urls": [
{
"end": 123,
"start": 123,
"description": "<string>",
"display_url": "<string>",
"expanded_url": "<string>",
"images": [
{
"height": 123,
"url": "<string>",
"width": 123
}
],
"media_key": "<string>",
"status": 123,
"title": "<string>",
"unwound_url": "<string>",
"url": "<string>"
}
]
},
"geo": {
"coordinates": {
"coordinates": [
123
],
"type": "Point"
},
"place_id": "<string>"
},
"id": "<string>",
"in_reply_to_user_id": "<string>",
"lang": "<string>",
"matched_media_notes": [
{
"match_status": "<string>",
"note_id": "<string>"
}
],
"media_metadata": [
{
"alt_text": "<string>",
"description": "<string>",
"media_key": "<string>",
"title": "<string>"
}
],
"non_public_metrics": {},
"note_post": {
"text": "<string>",
"entities": {
"cashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"hashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"mentions": [
{
"end": 123,
"start": 123,
"id": "<string>",
"username": "<string>"
}
],
"urls": [
{
"end": 123,
"start": 123,
"display_url": "<string>",
"expanded_url": "<string>",
"url": "<string>"
}
]
}
},
"note_request_suggestions": [
{
"source_link": "<string>",
"suggestion": "<string>",
"suggestion_id": "<string>"
}
],
"organic_metrics": {},
"paid_partnership": true,
"possibly_sensitive": true,
"promoted_metrics": {},
"public_metrics": {
"bookmark_count": 123,
"impression_count": 123,
"like_count": 123,
"quote_count": 123,
"reply_count": 123,
"repost_count": 123
},
"referenced_posts": [
{
"id": "<string>"
}
],
"reply_settings": "<string>",
"scopes": {
"followers": true
},
"source": "<string>",
"suggested_source_links": [
"<string>"
],
"suggested_source_links_with_counts": [
{
"count": 123,
"url": "<string>"
}
],
"text": "<string>",
"username": "<string>",
"withheld": {
"copyright": true,
"country_codes": [
"<string>"
]
}
}
],
"topics": [
{
"description": "<string>",
"id": "<string>",
"name": "<string>"
}
],
"users": [
{
"affiliation": {
"badge_url": "<string>",
"description": "<string>",
"url": "<string>",
"user_id": [
"<string>"
]
},
"confirmed_email": "<string>",
"connection_status": [],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"entities": {
"description": {
"cashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"hashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"mentions": [
{
"end": 123,
"start": 123,
"username": "<string>",
"id": "<string>"
}
],
"urls": [
{
"end": 123,
"start": 123,
"url": "<string>",
"description": "<string>",
"display_url": "<string>",
"expanded_url": "<string>",
"images": [
{
"height": 123,
"url": "<string>",
"width": 123
}
],
"media_key": "<string>",
"status": 123,
"title": "<string>",
"unwound_url": "<string>"
}
]
},
"url": {
"urls": [
{
"end": 123,
"start": 123,
"url": "<string>",
"description": "<string>",
"display_url": "<string>",
"expanded_url": "<string>",
"images": [
{
"height": 123,
"url": "<string>",
"width": 123
}
],
"media_key": "<string>",
"status": 123,
"title": "<string>",
"unwound_url": "<string>"
}
]
}
},
"id": "<string>",
"is_identity_verified": true,
"location": "<string>",
"most_recent_post_id": "<string>",
"name": "<string>",
"parody": true,
"pinned_post_id": "<string>",
"profile_banner_url": "<string>",
"profile_image_url": "<string>",
"protected": true,
"public_metrics": {
"followers_count": 123,
"following_count": 123,
"listed_count": 123,
"post_count": 123,
"like_count": 123,
"media_count": 123
},
"receives_your_dm": true,
"subscribes_to_you": true,
"subscription": {
"subscribes_to_you": true
},
"subscription_type": "<string>",
"url": "<string>",
"username": "<string>",
"verified": true,
"verified_followers_count": 123,
"verified_type": "<string>",
"withheld": {
"country_codes": [
"<string>"
],
"scope": "user"
}
}
]
},
"meta": {
"next_token": "<string>",
"previous_token": "<string>",
"result_count": 123
}
}{
"code": 123,
"message": "<string>"
}Authorizations
OAuth2UserTokenUserTokenBearerToken
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Unique identifier of a User
Pattern:
^[0-9]{1,19}$Example:
"2244994945"
Query Parameters
Required range:
1 <= x <= 100A 64-bit signed integer.
A comma separated list of List fields to display. The fields available for a List object.
Minimum array length:
1Available options:
created_at, description, follower_count, id, member_count, name, private A comma separated list of fields to expand.
Minimum array length:
1Available options:
owner_id A comma separated list of User fields to display. The fields available for a User object.
Minimum array length:
1Available options:
confirmed_email, connection_status, created_at, description, entities, id, is_identity_verified, location, name, parody, profile_banner_url, profile_image_url, protected, public_metrics, receives_your_dm, subscribes_to_you, subscription, subscription_type, url, username, verified, verified_followers_count, verified_type, withheld ⌘I
Get Users Owned Lists
curl --request GET \
--url https://api.x.com/2/users/{id}/owned_lists \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.x.com/2/users/{id}/owned_lists"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.x.com/2/users/{id}/owned_lists', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/users/{id}/owned_lists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/users/{id}/owned_lists"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.x.com/2/users/{id}/owned_lists")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/users/{id}/owned_lists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"created_at": "<string>",
"description": "<string>",
"follower_count": 123,
"id": "<string>",
"member_count": 123,
"name": "<string>",
"owner_id": "<string>",
"private": true
}
],
"errors": [
{
"detail": "<string>",
"resource_type": "<string>",
"title": "<string>",
"type": "https://api.x.com/2/problems/resource-not-found",
"parameter": "<string>",
"resource_id": "<string>",
"status": 123,
"value": "<string>"
}
],
"includes": {
"media": [
{
"alt_text": "<string>",
"duration_ms": 123,
"height": 123,
"media_key": "<string>",
"non_public_metrics": {
"playback_0_count": 123,
"playback_100_count": 123,
"playback_25_count": 123,
"playback_50_count": 123,
"playback_75_count": 123
},
"organic_metrics": {
"playback_0_count": 123,
"playback_100_count": 123,
"playback_25_count": 123,
"playback_50_count": 123,
"playback_75_count": 123,
"view_count": 123
},
"preview_image_url": "<string>",
"promoted_metrics": {
"playback_0_count": 123,
"playback_100_count": 123,
"playback_25_count": 123,
"playback_50_count": 123,
"playback_75_count": 123,
"view_count": 123
},
"public_metrics": {
"view_count": 123
},
"type": "<string>",
"url": "<string>",
"variants": [
{
"bit_rate": 123,
"content_type": "<string>",
"url": "<string>"
}
],
"width": 123
}
],
"places": [
{
"contained_within": [
"<string>"
],
"country": "<string>",
"country_code": "<string>",
"full_name": "<string>",
"geo": {
"bbox": [
123
],
"properties": {},
"type": "Feature"
},
"id": "<string>",
"name": "<string>",
"place_type": "<string>"
}
],
"polls": [
{
"duration_minutes": 123,
"end_datetime": "<string>",
"id": "<string>",
"options": [
{
"label": "<string>",
"position": 123,
"votes": 123
}
],
"voting_status": "<string>"
}
],
"posts": [
{
"article": {},
"article_title": {},
"attachments": {
"media_keys": [
"<string>"
],
"media_source_tweet_id": [
"<string>"
],
"poll_ids": [
"<string>"
]
},
"author_id": "<string>",
"card_uri": "<string>",
"community_id": "<string>",
"context_annotations": [
{
"domain": {
"description": "<string>",
"id": "<string>",
"name": "<string>"
},
"entity": {
"description": "<string>",
"id": "<string>",
"name": "<string>"
}
}
],
"conversation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"display_text_range": [
123
],
"edit_controls": {
"editable_until": "<string>",
"edits_remaining": 123,
"is_edit_eligible": true
},
"edit_history_post_ids": [
"<string>"
],
"entities": {
"cashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"hashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"mentions": [
{
"end": 123,
"start": 123,
"id": "<string>",
"username": "<string>"
}
],
"urls": [
{
"end": 123,
"start": 123,
"description": "<string>",
"display_url": "<string>",
"expanded_url": "<string>",
"images": [
{
"height": 123,
"url": "<string>",
"width": 123
}
],
"media_key": "<string>",
"status": 123,
"title": "<string>",
"unwound_url": "<string>",
"url": "<string>"
}
]
},
"geo": {
"coordinates": {
"coordinates": [
123
],
"type": "Point"
},
"place_id": "<string>"
},
"id": "<string>",
"in_reply_to_user_id": "<string>",
"lang": "<string>",
"matched_media_notes": [
{
"match_status": "<string>",
"note_id": "<string>"
}
],
"media_metadata": [
{
"alt_text": "<string>",
"description": "<string>",
"media_key": "<string>",
"title": "<string>"
}
],
"non_public_metrics": {},
"note_post": {
"text": "<string>",
"entities": {
"cashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"hashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"mentions": [
{
"end": 123,
"start": 123,
"id": "<string>",
"username": "<string>"
}
],
"urls": [
{
"end": 123,
"start": 123,
"display_url": "<string>",
"expanded_url": "<string>",
"url": "<string>"
}
]
}
},
"note_request_suggestions": [
{
"source_link": "<string>",
"suggestion": "<string>",
"suggestion_id": "<string>"
}
],
"organic_metrics": {},
"paid_partnership": true,
"possibly_sensitive": true,
"promoted_metrics": {},
"public_metrics": {
"bookmark_count": 123,
"impression_count": 123,
"like_count": 123,
"quote_count": 123,
"reply_count": 123,
"repost_count": 123
},
"referenced_posts": [
{
"id": "<string>"
}
],
"reply_settings": "<string>",
"scopes": {
"followers": true
},
"source": "<string>",
"suggested_source_links": [
"<string>"
],
"suggested_source_links_with_counts": [
{
"count": 123,
"url": "<string>"
}
],
"text": "<string>",
"username": "<string>",
"withheld": {
"copyright": true,
"country_codes": [
"<string>"
]
}
}
],
"topics": [
{
"description": "<string>",
"id": "<string>",
"name": "<string>"
}
],
"users": [
{
"affiliation": {
"badge_url": "<string>",
"description": "<string>",
"url": "<string>",
"user_id": [
"<string>"
]
},
"confirmed_email": "<string>",
"connection_status": [],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"entities": {
"description": {
"cashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"hashtags": [
{
"end": 123,
"start": 123,
"tag": "<string>"
}
],
"mentions": [
{
"end": 123,
"start": 123,
"username": "<string>",
"id": "<string>"
}
],
"urls": [
{
"end": 123,
"start": 123,
"url": "<string>",
"description": "<string>",
"display_url": "<string>",
"expanded_url": "<string>",
"images": [
{
"height": 123,
"url": "<string>",
"width": 123
}
],
"media_key": "<string>",
"status": 123,
"title": "<string>",
"unwound_url": "<string>"
}
]
},
"url": {
"urls": [
{
"end": 123,
"start": 123,
"url": "<string>",
"description": "<string>",
"display_url": "<string>",
"expanded_url": "<string>",
"images": [
{
"height": 123,
"url": "<string>",
"width": 123
}
],
"media_key": "<string>",
"status": 123,
"title": "<string>",
"unwound_url": "<string>"
}
]
}
},
"id": "<string>",
"is_identity_verified": true,
"location": "<string>",
"most_recent_post_id": "<string>",
"name": "<string>",
"parody": true,
"pinned_post_id": "<string>",
"profile_banner_url": "<string>",
"profile_image_url": "<string>",
"protected": true,
"public_metrics": {
"followers_count": 123,
"following_count": 123,
"listed_count": 123,
"post_count": 123,
"like_count": 123,
"media_count": 123
},
"receives_your_dm": true,
"subscribes_to_you": true,
"subscription": {
"subscribes_to_you": true
},
"subscription_type": "<string>",
"url": "<string>",
"username": "<string>",
"verified": true,
"verified_followers_count": 123,
"verified_type": "<string>",
"withheld": {
"country_codes": [
"<string>"
],
"scope": "user"
}
}
]
},
"meta": {
"next_token": "<string>",
"previous_token": "<string>",
"result_count": 123
}
}{
"code": 123,
"message": "<string>"
}