Skip to content

Commit 6001ecb

Browse files
feat(api): api update
1 parent 763fdb3 commit 6001ecb

60 files changed

Lines changed: 7620 additions & 668 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 123
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-5f26f3694399b4ac5a4431c66f7d27c4024f9d0dcd899702de5fde1150e28330.yml
3-
openapi_spec_hash: 362e24e622f9a74ded8b38018e50460c
4-
config_hash: dab26921eb273c16e5570c0485c9ac2c
1+
configured_endpoints: 124
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-7bcac1557175956021a62532c55ce29b8822b5a41d0d59ae67787a6326c0ef8a.yml
3+
openapi_spec_hash: 04e28f19097d9b59119101492100c4ab
4+
config_hash: 217d68ca6999ad03cfc4922e9658297e

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,10 @@ client = XTwitterScraper(
123123
api_key=os.environ.get("X_TWITTER_SCRAPER_API_KEY"), # This is the default and can be omitted
124124
)
125125

126-
paginated_tweets = client.x.tweets.search(
126+
response = client.x.tweets.search(
127127
q="from:elonmusk",
128128
limit=10,
129129
)
130-
print(paginated_tweets.has_next_page)
131130
```
132131

133132
While you can provide an `api_key` keyword argument,
@@ -150,11 +149,10 @@ client = AsyncXTwitterScraper(
150149

151150

152151
async def main() -> None:
153-
paginated_tweets = await client.x.tweets.search(
152+
response = await client.x.tweets.search(
154153
q="from:elonmusk",
155154
limit=10,
156155
)
157-
print(paginated_tweets.has_next_page)
158156

159157

160158
asyncio.run(main())
@@ -189,11 +187,10 @@ async def main() -> None:
189187
), # This is the default and can be omitted
190188
http_client=DefaultAioHttpClient(),
191189
) as client:
192-
paginated_tweets = await client.x.tweets.search(
190+
response = await client.x.tweets.search(
193191
q="from:elonmusk",
194192
limit=10,
195193
)
196-
print(paginated_tweets.has_next_page)
197194

198195

199196
asyncio.run(main())

api.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ from x_twitter_scraper.types.x import (
277277
TweetRetrieveResponse,
278278
TweetDeleteResponse,
279279
TweetGetRepliesResponse,
280+
TweetSearchResponse,
280281
)
281282
```
282283

@@ -291,7 +292,7 @@ Methods:
291292
- <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>
292293
- <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>
293294
- <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>
294-
- <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>
295+
- <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/x/tweet_search_response.py">TweetSearchResponse</a></code>
295296

296297
### Like
297298

@@ -324,24 +325,30 @@ Methods:
324325
Types:
325326

326327
```python
327-
from x_twitter_scraper.types.x import UserRemoveFollowerResponse, UserRetrieveBatchResponse
328+
from x_twitter_scraper.types.x import (
329+
UserRemoveFollowerResponse,
330+
UserRetrieveBatchResponse,
331+
UserRetrieveFollowersResponse,
332+
UserRetrieveFollowingResponse,
333+
UserRetrieveVerifiedFollowersResponse,
334+
)
328335
```
329336

330337
Methods:
331338

332339
- <code title="get /x/users/{id}">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve</a>(id) -> <a href="./src/x_twitter_scraper/types/shared/user_profile.py">UserProfile</a></code>
333340
- <code title="post /x/users/{id}/remove-follower">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">remove_follower</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_remove_follower_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/user_remove_follower_response.py">UserRemoveFollowerResponse</a></code>
334341
- <code title="get /x/users/batch">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_batch</a>(\*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_batch_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/user_retrieve_batch_response.py">UserRetrieveBatchResponse</a></code>
335-
- <code title="get /x/users/{id}/followers">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_followers</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_followers_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
342+
- <code title="get /x/users/{id}/followers">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_followers</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_followers_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/user_retrieve_followers_response.py">UserRetrieveFollowersResponse</a></code>
336343
- <code title="get /x/users/{id}/followers-you-know">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_followers_you_know</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_followers_you_know_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
337-
- <code title="get /x/users/{id}/following">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_following</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_following_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
344+
- <code title="get /x/users/{id}/following">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_following</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_following_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/user_retrieve_following_response.py">UserRetrieveFollowingResponse</a></code>
338345
- <code title="get /x/users/{id}/likes">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_likes</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_likes_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
339346
- <code title="get /x/users/{id}/media">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_media</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_media_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
340347
- <code title="get /x/users/{id}/mentions">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_mentions</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_mentions_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
341348
- <code title="get /x/users/{id}/replies">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_replies</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_replies_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
342349
- <code title="get /x/users/search">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_search</a>(\*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_search_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
343350
- <code title="get /x/users/{id}/tweets">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_tweets</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_tweets_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_tweets.py">PaginatedTweets</a></code>
344-
- <code title="get /x/users/{id}/verified-followers">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_verified_followers</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_verified_followers_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/shared/paginated_users.py">PaginatedUsers</a></code>
351+
- <code title="get /x/users/{id}/verified-followers">client.x.users.<a href="./src/x_twitter_scraper/resources/x/users/users.py">retrieve_verified_followers</a>(id, \*\*<a href="src/x_twitter_scraper/types/x/user_retrieve_verified_followers_params.py">params</a>) -> <a href="./src/x_twitter_scraper/types/x/user_retrieve_verified_followers_response.py">UserRetrieveVerifiedFollowersResponse</a></code>
345352

346353
### Follow
347354

@@ -537,6 +544,12 @@ Methods:
537544

538545
# Support
539546

547+
## Attachments
548+
549+
Methods:
550+
551+
- <code title="get /support/attachments/{id}">client.support.attachments.<a href="./src/x_twitter_scraper/resources/support/attachments.py">download</a>(id) -> BinaryAPIResponse</code>
552+
540553
## Tickets
541554

542555
Types:

src/x_twitter_scraper/resources/draws.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def list(
108108
List draws
109109
110110
Args:
111-
cursor: Cursor for keyset pagination from prior response next_cursor
111+
cursor: Previous nextCursor.
112112
113113
limit: Maximum number of items to return (1-100, default 50). For paid per-result
114114
endpoints, the returned count may be lower when remaining credits cannot cover
@@ -154,11 +154,13 @@ def export(
154154
extra_body: Body | None = None,
155155
timeout: float | httpx.Timeout | None | NotGiven = not_given,
156156
) -> BinaryAPIResponse:
157-
"""
158-
Export draw data
157+
"""Export draw data
159158
160159
Args:
161-
format: Export output format
160+
format: Export output format.
161+
162+
PDF entry exports include up to 10,000 rows. Other entry
163+
formats include up to 100,000 rows.
162164
163165
type: Export winners or all entries
164166
@@ -326,7 +328,7 @@ async def list(
326328
List draws
327329
328330
Args:
329-
cursor: Cursor for keyset pagination from prior response next_cursor
331+
cursor: Previous nextCursor.
330332
331333
limit: Maximum number of items to return (1-100, default 50). For paid per-result
332334
endpoints, the returned count may be lower when remaining credits cannot cover
@@ -372,11 +374,13 @@ async def export(
372374
extra_body: Body | None = None,
373375
timeout: float | httpx.Timeout | None | NotGiven = not_given,
374376
) -> AsyncBinaryAPIResponse:
375-
"""
376-
Export draw data
377+
"""Export draw data
377378
378379
Args:
379-
format: Export output format
380+
format: Export output format.
381+
382+
PDF entry exports include up to 10,000 rows. Other entry
383+
formats include up to 100,000 rows.
380384
381385
type: Export winners or all entries
382386

src/x_twitter_scraper/resources/events.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def list(
8787
*,
8888
cursor: str | Omit = omit,
8989
event_type: EventType | Omit = omit,
90+
keyword_monitor_id: str | Omit = omit,
9091
limit: int | Omit = omit,
9192
monitor_id: str | Omit = omit,
9293
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -100,16 +101,18 @@ def list(
100101
List events
101102
102103
Args:
103-
cursor: Cursor for keyset pagination from prior response next_cursor
104+
cursor: Previous nextCursor.
104105
105106
event_type: Filter events by type
106107
108+
keyword_monitor_id: Keyword monitor ID.
109+
107110
limit: Maximum number of items to return (1-100, default 50). For paid per-result
108111
endpoints, the returned count may be lower when remaining credits cannot cover
109112
the requested page. If zero paid results are affordable, the endpoint returns
110113
402 insufficient_credits.
111114
112-
monitor_id: Filter events by monitor ID
115+
monitor_id: Account monitor ID.
113116
114117
extra_headers: Send extra headers
115118
@@ -130,6 +133,7 @@ def list(
130133
{
131134
"cursor": cursor,
132135
"event_type": event_type,
136+
"keyword_monitor_id": keyword_monitor_id,
133137
"limit": limit,
134138
"monitor_id": monitor_id,
135139
},
@@ -200,6 +204,7 @@ async def list(
200204
*,
201205
cursor: str | Omit = omit,
202206
event_type: EventType | Omit = omit,
207+
keyword_monitor_id: str | Omit = omit,
203208
limit: int | Omit = omit,
204209
monitor_id: str | Omit = omit,
205210
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -213,16 +218,18 @@ async def list(
213218
List events
214219
215220
Args:
216-
cursor: Cursor for keyset pagination from prior response next_cursor
221+
cursor: Previous nextCursor.
217222
218223
event_type: Filter events by type
219224
225+
keyword_monitor_id: Keyword monitor ID.
226+
220227
limit: Maximum number of items to return (1-100, default 50). For paid per-result
221228
endpoints, the returned count may be lower when remaining credits cannot cover
222229
the requested page. If zero paid results are affordable, the endpoint returns
223230
402 insufficient_credits.
224231
225-
monitor_id: Filter events by monitor ID
232+
monitor_id: Account monitor ID.
226233
227234
extra_headers: Send extra headers
228235
@@ -243,6 +250,7 @@ async def list(
243250
{
244251
"cursor": cursor,
245252
"event_type": event_type,
253+
"keyword_monitor_id": keyword_monitor_id,
246254
"limit": limit,
247255
"monitor_id": monitor_id,
248256
},

0 commit comments

Comments
 (0)