| Name | twikit JSON |
| Version |
2.1.2
JSON |
| download |
| home_page | https://github.com/d60/twikit |
| Summary | Twitter API wrapper for python with **no API key required**. |
| upload_time | 2024-08-13 14:42:24 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | MIT |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
<img src="https://i.imgur.com/iJe6rsZ.png" width="500">



[](https://twitter.com/intent/tweet?text=Create%20your%20own%20Twitter%20bot%20for%20free%20with%20%22Twikit%22!%20%23python%20%23twitter%20%23twikit%20%23programming%20%23github%20%23bot&url=https%3A%2F%2Fgithub.com%2Fd60%2Ftwikit)
[](https://discord.gg/nCrByrr8cX)
[](https://www.buymeacoffee.com/d60py)
[[日本語](https://github.com/d60/twikit/blob/main/README-ja.md)]
[[中文](https://github.com/d60/twikit/blob/main/README-zh.md)]
# Twikit <img height="35" src="https://i.imgur.com/9HSdIl4.png" valign="bottom">
A Simple Twitter API Scraper
You can use functions such as posting or searching for tweets without an API key using this library.
- [Documentation (English)](https://twikit.readthedocs.io/en/latest/twikit.html)
🔵 [Discord](https://discord.gg/nCrByrr8cX)
> [!IMPORTANT]
> With the release of version 2.0.0 on July 11, there have been some specification changes, including the discontinuation of the synchronous version. Existing code will no longer work with v2.0.0 or later, so please refer to the [documentation](https://twikit.readthedocs.io/en/latest/twikit.html) or the code in the [examples folder](https://github.com/d60/twikit/tree/main/examples) for adjustments.
> We apologize for any inconvenience this may cause.
## Features
### No API Key Required
This library uses scraping and does not require an API key.
### Free
This library is free to use.
## Functionality
By using Twikit, you can access functionalities such as the following:
- Create tweets
- Search tweets
- Retrieve trending topics
- etc...
## Installing
```bash
pip install twikit
```
## Quick Example
**Define a client and log in to the account.**
```python
import asyncio
from twikit import Client
USERNAME = 'example_user'
EMAIL = 'email@example.com'
PASSWORD = 'password0000'
# Initialize client
client = Client('en-US')
async def main():
await client.login(
auth_info_1=USERNAME ,
auth_info_2=EMAIL,
password=PASSWORD
)
asyncio.run(main())
```
**Create a tweet with media attached.**
```python
# Upload media files and obtain media_ids
media_ids = [
await client.upload_media('media1.jpg'),
await client.upload_media('media2.jpg')
]
# Create a tweet with the provided text and attached media
await client.create_tweet(
text='Example Tweet',
media_ids=media_ids
)
```
**Search the latest tweets based on a keyword**
```python
tweets = await client.search_tweet('python', 'Latest')
for tweet in tweets:
print(
tweet.user.name,
tweet.text,
tweet.created_at
)
```
**Retrieve user tweets**
```python
tweets = await client.get_user_tweets('123456', 'Tweets')
for tweet in tweets:
print(tweet.text)
```
**Send a dm**
```python
await client.send_dm('123456789', 'Hello')
```
**Get trends**
```python
await client.get_trends('trending')
```
More Examples: [examples](https://github.com/d60/twikit/tree/main/examples) <br>
## Contributing
If you encounter any bugs or issues, please report them on [issues](https://github.com/d60/twikit/issues).
If you find this library useful, consider starring this repository⭐️
Raw data
{
"_id": null,
"home_page": "https://github.com/d60/twikit",
"name": "twikit",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/2a/04/8383d23406710a0e848fd11a1b8937cb787e1dafb98898879f468955c50e/twikit-2.1.2.tar.gz",
"platform": null,
"description": "<img src=\"https://i.imgur.com/iJe6rsZ.png\" width=\"500\">\r\n\r\n\r\n\r\n\r\n\r\n\r\n[](https://twitter.com/intent/tweet?text=Create%20your%20own%20Twitter%20bot%20for%20free%20with%20%22Twikit%22!%20%23python%20%23twitter%20%23twikit%20%23programming%20%23github%20%23bot&url=https%3A%2F%2Fgithub.com%2Fd60%2Ftwikit)\r\n[](https://discord.gg/nCrByrr8cX)\r\n[](https://www.buymeacoffee.com/d60py)\r\n\r\n[[\u65e5\u672c\u8a9e](https://github.com/d60/twikit/blob/main/README-ja.md)]\r\n[[\u4e2d\u6587](https://github.com/d60/twikit/blob/main/README-zh.md)]\r\n\r\n\r\n# Twikit <img height=\"35\" src=\"https://i.imgur.com/9HSdIl4.png\" valign=\"bottom\">\r\n\r\nA Simple Twitter API Scraper\r\n\r\nYou can use functions such as posting or searching for tweets without an API key using this library.\r\n\r\n- [Documentation (English)](https://twikit.readthedocs.io/en/latest/twikit.html)\r\n\r\n\r\n\ud83d\udd35 [Discord](https://discord.gg/nCrByrr8cX)\r\n\r\n> [!IMPORTANT]\r\n> With the release of version 2.0.0 on July 11, there have been some specification changes, including the discontinuation of the synchronous version. Existing code will no longer work with v2.0.0 or later, so please refer to the [documentation](https://twikit.readthedocs.io/en/latest/twikit.html) or the code in the [examples folder](https://github.com/d60/twikit/tree/main/examples) for adjustments.\r\n> We apologize for any inconvenience this may cause.\r\n\r\n\r\n\r\n\r\n## Features\r\n\r\n### No API Key Required\r\n\r\nThis library uses scraping and does not require an API key.\r\n\r\n### Free\r\n\r\nThis library is free to use.\r\n\r\n\r\n## Functionality\r\n\r\nBy using Twikit, you can access functionalities such as the following:\r\n\r\n- Create tweets\r\n\r\n- Search tweets\r\n\r\n- Retrieve trending topics\r\n\r\n- etc...\r\n\r\n\r\n\r\n## Installing\r\n\r\n```bash\r\n\r\npip install twikit\r\n\r\n```\r\n\r\n\r\n\r\n## Quick Example\r\n\r\n**Define a client and log in to the account.**\r\n\r\n```python\r\nimport asyncio\r\nfrom twikit import Client\r\n\r\nUSERNAME = 'example_user'\r\nEMAIL = 'email@example.com'\r\nPASSWORD = 'password0000'\r\n\r\n# Initialize client\r\nclient = Client('en-US')\r\n\r\nasync def main():\r\n await client.login(\r\n auth_info_1=USERNAME ,\r\n auth_info_2=EMAIL,\r\n password=PASSWORD\r\n )\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n**Create a tweet with media attached.**\r\n\r\n```python\r\n# Upload media files and obtain media_ids\r\nmedia_ids = [\r\n await client.upload_media('media1.jpg'),\r\n await client.upload_media('media2.jpg')\r\n]\r\n\r\n# Create a tweet with the provided text and attached media\r\nawait client.create_tweet(\r\n text='Example Tweet',\r\n media_ids=media_ids\r\n)\r\n\r\n```\r\n\r\n**Search the latest tweets based on a keyword**\r\n```python\r\ntweets = await client.search_tweet('python', 'Latest')\r\n\r\nfor tweet in tweets:\r\n print(\r\n tweet.user.name,\r\n tweet.text,\r\n tweet.created_at\r\n )\r\n```\r\n\r\n**Retrieve user tweets**\r\n```python\r\ntweets = await client.get_user_tweets('123456', 'Tweets')\r\n\r\nfor tweet in tweets:\r\n print(tweet.text)\r\n```\r\n\r\n**Send a dm**\r\n```python\r\nawait client.send_dm('123456789', 'Hello')\r\n```\r\n\r\n**Get trends**\r\n```python\r\nawait client.get_trends('trending')\r\n```\r\n\r\nMore Examples: [examples](https://github.com/d60/twikit/tree/main/examples) <br>\r\n\r\n## Contributing\r\n\r\nIf you encounter any bugs or issues, please report them on [issues](https://github.com/d60/twikit/issues).\r\n\r\n\r\nIf you find this library useful, consider starring this repository\u2b50\ufe0f\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Twitter API wrapper for python with **no API key required**.",
"version": "2.1.2",
"project_urls": {
"Homepage": "https://github.com/d60/twikit"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "15bbe8e55ac971629204040a4648eb2799ee1da2758fbfb58dd0ca4c6d2470d9",
"md5": "87145f5ec641006f0b2ddcc1ccb845fc",
"sha256": "c76b9b677b4936bbe13608d063d0f82cb8ae64f72e2873070bd7f6193dcc66e5"
},
"downloads": -1,
"filename": "twikit-2.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "87145f5ec641006f0b2ddcc1ccb845fc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 71679,
"upload_time": "2024-08-13T14:42:22",
"upload_time_iso_8601": "2024-08-13T14:42:22.879617Z",
"url": "https://files.pythonhosted.org/packages/15/bb/e8e55ac971629204040a4648eb2799ee1da2758fbfb58dd0ca4c6d2470d9/twikit-2.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2a048383d23406710a0e848fd11a1b8937cb787e1dafb98898879f468955c50e",
"md5": "c1ff511321c34b8c398c31e59b5e0890",
"sha256": "982d756581b0eb053a4948ff8f9069afaaae79b9e295a0540a95fd4878b6d648"
},
"downloads": -1,
"filename": "twikit-2.1.2.tar.gz",
"has_sig": false,
"md5_digest": "c1ff511321c34b8c398c31e59b5e0890",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 62435,
"upload_time": "2024-08-13T14:42:24",
"upload_time_iso_8601": "2024-08-13T14:42:24.382941Z",
"url": "https://files.pythonhosted.org/packages/2a/04/8383d23406710a0e848fd11a1b8937cb787e1dafb98898879f468955c50e/twikit-2.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-13 14:42:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "d60",
"github_project": "twikit",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "twikit"
}