Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 123
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-323137ebb1ee9824cd9cfb63a325c0839deb81f17244e42e8154d6567e7af954.yml
openapi_spec_hash: 48da9c2747c1e7c474dd514d39c28c49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-5f26f3694399b4ac5a4431c66f7d27c4024f9d0dcd899702de5fde1150e28330.yml
openapi_spec_hash: 362e24e622f9a74ded8b38018e50460c
config_hash: dab26921eb273c16e5570c0485c9ac2c
6 changes: 4 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ from x_twitter_scraper.types.x import (
TweetCreateResponse,
TweetRetrieveResponse,
TweetDeleteResponse,
TweetGetRepliesResponse,
)
```

Expand All @@ -287,7 +288,7 @@ Methods:
- <code title="delete /x/tweets/{id}">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">delete</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_delete_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/tweet_delete_response.py">TweetDeleteResponse</a></code>
- <code title="get /x/tweets/{id}/favoriters">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">get_favoriters</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_get_favoriters_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
- <code title="get /x/tweets/{id}/quotes">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">get_quotes</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_get_quotes_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
- <code title="get /x/tweets/{id}/replies">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">get_replies</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_get_replies_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
- <code title="get /x/tweets/{id}/replies">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">get_replies</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_get_replies_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/tweet_get_replies_response.py">TweetGetRepliesResponse</a></code>
- <code title="get /x/tweets/{id}/retweeters">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">get_retweeters</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_get_retweeters_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
- <code title="get /x/tweets/{id}/thread">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">get_thread</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/tweet_get_thread_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
- <code title="get /x/tweets/search">client.x.tweets.<a href="./src/x_twitter_scraper/resources/x/tweets/tweets.py">search</a>(\*\*<a href="src/x_twitter_scraper/types/x/tweet_search_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
Expand Down Expand Up @@ -460,6 +461,7 @@ Types:
from x_twitter_scraper.types.x import (
XAccount,
XAccountDetail,
AccountCreateResponse,
AccountListResponse,
AccountDeleteResponse,
AccountBulkRetryResponse,
Expand All @@ -469,7 +471,7 @@ from x_twitter_scraper.types.x import (

Methods:

- <code title="post /x/accounts">client.x.accounts.<a href="./src/x_twitter_scraper/resources/x/accounts.py">create</a>(\*\*<a href="src/x_twitter_scraper/types/x/account_create_params.py">params</a>) -> object</code>
- <code title="post /x/accounts">client.x.accounts.<a href="./src/x_twitter_scraper/resources/x/accounts.py">create</a>(\*\*<a href="src/x_twitter_scraper/types/x/account_create_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/account_create_response.py">AccountCreateResponse</a></code>
- <code title="get /x/accounts/{id}">client.x.accounts.<a href="./src/x_twitter_scraper/resources/x/accounts.py">retrieve</a>(id) -> <a href="./src/x_twitter_scraper/types/x/x_account_detail.py">XAccountDetail</a></code>
- <code title="get /x/accounts">client.x.accounts.<a href="./src/x_twitter_scraper/resources/x/accounts.py">list</a>() -> <a href="./src/x_twitter_scraper/types/x/account_list_response.py">AccountListResponse</a></code>
- <code title="delete /x/accounts/{id}">client.x.accounts.<a href="./src/x_twitter_scraper/resources/x/accounts.py">delete</a>(id) -> <a href="./src/x_twitter_scraper/types/x/account_delete_response.py">AccountDeleteResponse</a></code>
Expand Down
73 changes: 43 additions & 30 deletions src/x_twitter_scraper/resources/x/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

from __future__ import annotations

from typing import Any, cast

import httpx

from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
Expand All @@ -22,6 +24,7 @@
from ..._base_client import make_request_options
from ...types.x.x_account_detail import XAccountDetail
from ...types.x.account_list_response import AccountListResponse
from ...types.x.account_create_response import AccountCreateResponse
from ...types.x.account_delete_response import AccountDeleteResponse
from ...types.x.account_reauth_response import AccountReauthResponse
from ...types.x.account_bulk_retry_response import AccountBulkRetryResponse
Expand Down Expand Up @@ -64,7 +67,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
) -> AccountCreateResponse:
"""
Connect X account

Expand All @@ -85,21 +88,26 @@ def create(

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/x/accounts",
body=maybe_transform(
{
"email": email,
"password": password,
"totp_secret": totp_secret,
"username": username,
},
account_create_params.AccountCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
AccountCreateResponse,
self._post(
"/x/accounts",
body=maybe_transform(
{
"email": email,
"password": password,
"totp_secret": totp_secret,
"username": username,
},
account_create_params.AccountCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=cast(
Any, AccountCreateResponse
), # Union types cannot be passed in as arguments in the type system
),
cast_to=object,
)

def retrieve(
Expand Down Expand Up @@ -295,7 +303,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
) -> AccountCreateResponse:
"""
Connect X account

Expand All @@ -316,21 +324,26 @@ async def create(

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/x/accounts",
body=await async_maybe_transform(
{
"email": email,
"password": password,
"totp_secret": totp_secret,
"username": username,
},
account_create_params.AccountCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
AccountCreateResponse,
await self._post(
"/x/accounts",
body=await async_maybe_transform(
{
"email": email,
"password": password,
"totp_secret": totp_secret,
"username": username,
},
account_create_params.AccountCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=cast(
Any, AccountCreateResponse
), # Union types cannot be passed in as arguments in the type system
),
cast_to=object,
)

async def retrieve(
Expand Down
12 changes: 4 additions & 8 deletions src/x_twitter_scraper/resources/x/communities/communities.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,8 @@ def retrieve_search(

cursor: Pagination cursor for community search

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

query_type: Sort order (Latest or Top)
Expand Down Expand Up @@ -649,10 +647,8 @@ async def retrieve_search(

cursor: Pagination cursor for community search

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

query_type: Sort order (Latest or Top)
Expand Down
24 changes: 8 additions & 16 deletions src/x_twitter_scraper/resources/x/communities/tweets.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ def list(

cursor: Pagination cursor for community results

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

query_type: Sort order for community results (Latest or Top)
Expand Down Expand Up @@ -130,10 +128,8 @@ def list_by_community(
Args:
cursor: Pagination cursor for community tweets

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

extra_headers: Send extra headers
Expand Down Expand Up @@ -212,10 +208,8 @@ async def list(

cursor: Pagination cursor for community results

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

query_type: Sort order for community results (Latest or Top)
Expand Down Expand Up @@ -268,10 +262,8 @@ async def list_by_community(
Args:
cursor: Pagination cursor for community tweets

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

extra_headers: Send extra headers
Expand Down
12 changes: 4 additions & 8 deletions src/x_twitter_scraper/resources/x/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ def retrieve_tweets(

include_replies: Include replies (default false)

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

since_time: Unix timestamp - filter after
Expand Down Expand Up @@ -362,10 +360,8 @@ async def retrieve_tweets(

include_replies: Include replies (default false)

page_size: Maximum items requested from this page (1-100, default 20). The response can
contain fewer items because the source returned fewer, filters removed items, or
remaining credits cover fewer results. Keep requesting next_cursor while
has_next_page is true, even when a page is empty. The deprecated limit and count
page_size: Maximum page items (1-100, default 20). Source, filters, or credits can reduce
results. Continue while has_next_page is true. Deprecated limit and count
aliases remain accepted.

since_time: Unix timestamp - filter after
Expand Down
Loading