screen_nameパラメータや user_idパラメータで指定したユーザーが投稿した 最新のツイート集を取得します。
プロテクトユーザのタイムラインは、メソッドを実行する認証ユーザーがそのタイムラインを“所有している(owns)”場合か、所有者の承認済みフォロワーである場合にのみリクエストできます。
取得されるタイムラインは、twitter.comでユーザーのプロフィールを見た時に表示されるものと同じです。
このメソッドではユーザーの最新ツイートを最大で3200個取得することができます。リクエスト時にinclude_rtsにfalseを設定しているかどうかに関わらず、このユーザーの他のステータスのリツイートもこの合計に含まれます。
タイムラインを扱う手順についてはタイムラインを処理するを参照してください。
ディスプレイ要件に従ってツイートを描写するツールについては、Embeddable Timelines, Embeddable Tweets, GET statuses/oembedを参照してください。
https://api.twitter.com/1.1/statuses/user_timeline.json
ユーザーのタイムラインに利癖巣とする場合は、常にuser_id か screen_nameどちらかは設定してください。
検索結果を取得するユーザーのID。
サンプル値: 12345
検索結果を取得するユーザーのスクリーンネーム
サンプル値: noradio
これに指定したIDよりも大きい(より新しい)IDの検索結果を取得します。このAPIでアクセスできるツイート数には制限があります。 since_idで設定した範囲がツイート数の制限に引っかかった場合、since_id は使用できる範囲で最も古いIDに置き換えられます。
サンプル値: 12345
取得するツイート数を設定します。最大値は200です。 count値が適用されると停止中のコンテンツや削除されたコンテンツが取り除かれるので、このパラメータは取得するツイートを制限するものとして考えるのがベストです。include_rtsを設定していなかったとしても、カウントにはリツイートも含まれます。 このAPIメソッドを使う時は常に include_rts=1 を送信することを推奨します。
これに指定したID以下(より古い)のIDの検索結果を取得します。
サンプル値: 54321
trueか t か 1を設定すると、取得したタイムライン上の各ツイートは、ツイート主のIDのみを持ったユーザーオブジェクトを内包します。 このパラメータを省略すると、完全なユーザーオブジェクトを取得します。
サンプル値: true
このパラメータを使うと、リプライがタイムライン上に表示されるのを防ぐことができます。
count パラメータと一緒にexclude_repliesパラメータを使用すると、最大でcount で指定した数のツイートが取得されます — これは、リツイートやリプライをフィルタする前に count パラメータがツイートを取得するためです。
このパラメータは JSON 形式の応答と XML 形式の応答でのみサポートされています。
サンプル値: true
このパラメータを使うと、サーバからの応答で得られるcontributors エレメントに、投稿者のscreen_name を含めることができます。 既定ではcontributors エレメントは投稿者のuser_id のみを内包しています。
サンプル値: true
falseを設定すると、タイムラインはリツイートを表示しません (ただ、表示されないリツイートもタイムラインの最大数やcountパラメータで抽出した範囲としてはカウントされています。)。注意: include_rtsパラメータと一緒に trim_user パラメータを使用している場合、リツイートには完全なユーザーオブジェクトが内包されています。
サンプル値: false
ログインして登録アプリケーションの一覧を参照してください。
GET
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2
[
{
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Wed Aug 29 17:12:58 +0000 2012",
"id_str": "240859602684612608",
"entities": {
"urls": [
{
"expanded_url": "https://dev.twitter.com/blog/twitter-certified-products",
"url": "https://t.co/MjJ8xAnT",
"indices": [
52,
73
],
"display_url": "dev.twitter.com/blog/twitter-c…"
}
],
"hashtags": [
],
"user_mentions": [
]
},
"in_reply_to_user_id_str": null,
"contributors": null,
"text": "Introducing the Twitter Certified Products Program: https://t.co/MjJ8xAnT",
"retweet_count": 121,
"in_reply_to_status_id_str": null,
"id": 240859602684612608,
"geo": null,
"retweeted": false,
"possibly_sensitive": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"profile_sidebar_fill_color": "DDEEF6",
"profile_sidebar_border_color": "C0DEED",
"profile_background_tile": false,
"name": "Twitter API",
"profile_image_url": "http://a0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
"created_at": "Wed May 23 06:01:13 +0000 2007",
"location": "San Francisco, CA",
"follow_request_sent": false,
"profile_link_color": "0084B4",
"is_translator": false,
"id_str": "6253282",
"entities": {
"url": {
"urls": [
{
"expanded_url": null,
"url": "http://dev.twitter.com",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
]
}
},
"default_profile": true,
"contributors_enabled": true,
"favourites_count": 24,
"url": "http://dev.twitter.com",
"profile_image_url_https": "https://si0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
"utc_offset": -28800,
"id": 6253282,
"profile_use_background_image": true,
"listed_count": 10775,
"profile_text_color": "333333",
"lang": "en",
"followers_count": 1212864,
"protected": false,
"notifications": null,
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png",
"profile_background_color": "C0DEED",
"verified": true,
"geo_enabled": true,
"time_zone": "Pacific Time (US & Canada)",
"description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
"default_profile_image": false,
"profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
"statuses_count": 3333,
"friends_count": 31,
"following": null,
"show_all_inline_media": false,
"screen_name": "twitterapi"
},
"in_reply_to_screen_name": null,
"source": "YoruFukurou",
"in_reply_to_status_id": null
},
{
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Sat Aug 25 17:26:51 +0000 2012",
"id_str": "239413543487819778",
"entities": {
"urls": [
{
"expanded_url": "https://dev.twitter.com/issues/485",
"url": "https://t.co/p5bOzH0k",
"indices": [
97,
118
],
"display_url": "dev.twitter.com/issues/485"
}
],
"hashtags": [
],
"user_mentions": [
]
},
"in_reply_to_user_id_str": null,
"contributors": null,
"text": "We are working to resolve issues with application management & logging in to the dev portal: https://t.co/p5bOzH0k ^TS",
"retweet_count": 105,
"in_reply_to_status_id_str": null,
"id": 239413543487819778,
"geo": null,
"retweeted": false,
"possibly_sensitive": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"profile_sidebar_fill_color": "DDEEF6",
"profile_sidebar_border_color": "C0DEED",
"profile_background_tile": false,
"name": "Twitter API",
"profile_image_url": "http://a0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
"created_at": "Wed May 23 06:01:13 +0000 2007",
"location": "San Francisco, CA",
"follow_request_sent": false,
"profile_link_color": "0084B4",
"is_translator": false,
"id_str": "6253282",
"entities": {
"url": {
"urls": [
{
"expanded_url": null,
"url": "http://dev.twitter.com",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
]
}
},
"default_profile": true,
"contributors_enabled": true,
"favourites_count": 24,
"url": "http://dev.twitter.com",
"profile_image_url_https": "https://si0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
"utc_offset": -28800,
"id": 6253282,
"profile_use_background_image": true,
"listed_count": 10775,
"profile_text_color": "333333",
"lang": "en",
"followers_count": 1212864,
"protected": false,
"notifications": null,
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png",
"profile_background_color": "C0DEED",
"verified": true,
"geo_enabled": true,
"time_zone": "Pacific Time (US & Canada)",
"description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
"default_profile_image": false,
"profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
"statuses_count": 3333,
"friends_count": 31,
"following": null,
"show_all_inline_media": false,
"screen_name": "twitterapi"
},
"in_reply_to_screen_name": null,
"source": "YoruFukurou",
"in_reply_to_status_id": null
}
]