https://github.com/dadananjesha/twitter-search-api
A minimum viable product written in Python using Django and the Django REST Framework with a sqlite database.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Keywords
Repository
A minimum viable product written in Python using Django and the Django REST Framework with a sqlite database.
Basic Info
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
Twitter Search API (Django project)
A lightweight and efficient Twitter Search API built with Python, Django, and Django REST Framework. This project utilizes the Twitter Search API to fetch, store, filter, and export tweets related to trending events and hashtags.
🚀 Features
- 🔍 Search Twitter - Fetch recent tweets based on trending hashtags or keywords.
- 🗄️ Store & Retrieve - Save tweets into a local SQLite database and retrieve them with flexible filtering options.
- 📤 Export to CSV - Export tweet data in CSV format for analysis.
- 🖥️ REST API Endpoints - Easily interact with tweet data using well-structured API endpoints.
📌 API Endpoints
1️⃣ Trigger a Twitter Search
Fetch tweets for high-traffic hashtags.
bash
GET /search/?query=YourSearchQuery
Example: http://127.0.0.1:8000/search/?query=ElectionDay
2️⃣ Retrieve Stored Tweets
Fetch tweets stored in the database with optional filtering.
bash
GET /twitterSearch/
GET /twitterSearch/?search=YourKeyword
Example: http://127.0.0.1:8000/twitterSearch/?search=ko
3️⃣ Export Tweets to CSV
Export stored tweets to CSV, selecting relevant columns.
bash
GET /twitterDataExport/
Example: http://127.0.0.1:8000/twitterDataExport/
📂 Project Structure

🛠️ Installation
1️⃣ Clone the Repository
bash
git clone https://github.com/yourusername/twitter-search-api.git
cd twitter-search-api
2️⃣ Create & Activate Virtual Environment
bash
python -m venv env
source env/bin/activate # On Windows use `env\Scripts\activate`
3️⃣ Install Dependencies
bash
pip install -r requirements.txt
4️⃣ Run Database Migrations
bash
python manage.py migrate
5️⃣ Start the Development Server
bash
python manage.py runserver
⚙️ Environment Variables
To connect to Twitter API, set up the following environment variables:
bash
TWITTER_API_KEY=<Your_Twitter_API_Key>
TWITTER_API_SECRET_KEY=<Your_Twitter_API_Secret_Key>
TWITTER_ACCESS_TOKEN=<Your_Twitter_Access_Token>
TWITTER_ACCESS_TOKEN_SECRET=<Your_Twitter_Access_Token_Secret>
🧪 Running Tests
Run the test suite to verify functionality:
bash
python manage.py test
🤝 Contributions
We welcome contributions! 🎉 To contribute: - Fork the repository. - Create a new branch. - Implement your changes. - Submit a pull request.
Ensure that your code is well-documented and includes relevant tests.
⭐️ Call-to-Action
If you find this project helpful, please consider: - Starring the repository to show your support. - Forking to contribute improvements. - Following for updates on future projects.
Your engagement helps boost visibility and encourages further collaboration!
📝 License
This project is licensed under the MIT License.
💙 Happy Coding! 🚀
Owner
- Name: DADA NANJESHA
- Login: DadaNanjesha
- Kind: user
- Location: BERLIN
- Repositories: 1
- Profile: https://github.com/DadaNanjesha
GitHub Events
Total
- Push event: 8
- Pull request event: 4
- Create event: 1
Last Year
- Push event: 8
- Pull request event: 4
- Create event: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 0
- Total pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- DadaNanjesha (4)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- Django ==3.1.7
- MarkupPy ==1.14
- PyYAML ==5.4.1
- asgiref ==3.3.1
- certifi ==2020.12.5
- chardet ==4.0.0
- defusedxml ==0.7.1
- diff-match-patch ==20200713
- django-import-export ==2.5.0
- djangorestframework ==3.12.2
- et-xmlfile ==1.0.1
- future ==0.18.2
- idna ==3.1
- jdcal ==1.4.1
- oauthlib ==3.1.0
- odfpy ==1.4.1
- openpyxl ==3.0.6
- python-twitter ==3.5
- pytz ==2021.1
- requests ==2.25.1
- requests-oauthlib ==1.3.0
- sqlparse ==0.4.1
- tablib ==3.0.0
- twitter ==1.18.0
- urllib3 ==1.26.3
- xlrd ==2.0.1
- xlwt ==1.3.0
- actions/checkout v3 composite
- actions/setup-python v4 composite
- python 3.9-slim build