https://github.com/ultralytics/flickr_scraper
Simple Flickr Image Scraper
https://github.com/ultralytics/flickr_scraper
flickr flickr-api image-downloader image-downloader-python image-scraper image-scraping photos scraper
Last synced: about 2 months ago
JSON representation
Simple Flickr Image Scraper
- Host: GitHub
- URL: https://github.com/ultralytics/flickr_scraper
- Owner: ultralytics
- License: agpl-3.0
- Created: 2020-02-21T21:41:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-05-11T00:13:41.000Z (about 2 months ago)
- Last Synced: 2025-05-11T00:26:44.069Z (about 2 months ago)
- Topics: flickr, flickr-api, image-downloader, image-downloader-python, image-scraper, image-scraping, photos, scraper
- Language: Python
- Homepage: https://ultralytics.com
- Size: 92.8 KB
- Stars: 223
- Watchers: 9
- Forks: 64
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# đ Introduction
The Flickr Scraper is a [Python](https://www.python.org/) tool designed to help you gather images from [Flickr](https://www.flickr.com/) for creating custom datasets, particularly useful for [Ultralytics YOLO](https://docs.ultralytics.com/models/yolo11/) model training. Based on your search criteria, this tool simplifies the process of collecting relevant images for various [computer vision tasks](https://docs.ultralytics.com/tasks/), streamlining your [dataset preparation](https://docs.ultralytics.com/guides/data-collection-and-annotation/) workflow. Learn more about datasets in our blog post on the [best computer vision datasets](https://www.ultralytics.com/blog/exploring-the-best-computer-vision-datasets-in-2025).
[](https://github.com/ultralytics/flickr_scraper/actions/workflows/format.yml)
[](https://discord.com/invite/ultralytics)
[](https://community.ultralytics.com/)
[](https://reddit.com/r/ultralytics)## đ Key Features
- **Keyword Search**: Find images on Flickr using specific keywords relevant to your project.
- **Direct Download**: Easily download images to assemble your [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) [dataset](https://www.ultralytics.com/glossary/benchmark-dataset).
- **Streamlined Data Collection**: Simplify the process of gathering training data for [model training](https://docs.ultralytics.com/modes/train/) with YOLO models.## đ§ Requirements
Ensure you have Python 3.7 or later installed. The necessary dependencies can be installed using [pip](https://pip.pypa.io/en/stable/):
```bash
pip install -U -r requirements.txt
```Key packages include:
- `flickrapi`: A Python wrapper for the Flickr API, essential for interacting with Flickr services. You can find more details on the [`flickrapi` PyPI page](https://pypi.org/project/flickrapi/).
## đ ī¸ Installation
To set up the Flickr scraper on your local machine, follow these steps using [Git](https://git-scm.com/):
```bash
# Clone the repository
git clone https://github.com/ultralytics/flickr_scraper# Navigate to the project directory
cd flickr_scraper# Install the required packages
pip install -U -r requirements.txt
```## âī¸ Running the Scraper
Before you begin scraping images:
1. **Get a Flickr API Key**: Obtain your unique API key and secret by applying [here](https://www.flickr.com/services/apps/create/apply).
2. **Configure API Credentials**: Insert your API key and secret into the `flickr_scraper.py` script:```python
# flickr_scraper.py
# Replace with your actual Flickr API key and secret
key = "YOUR_API_KEY"
secret = "YOUR_API_SECRET"
```3. **Execute the Script**: Run the script from your terminal, specifying your search query, the number of images to fetch (`--n`), and the `--download` flag to save them locally. Downloaded images are saved by default to the `flickr_scraper/images/` directory, organized into subfolders based on the search query.
**Important**: Be mindful of Flickr's API rate limits and terms of service. Excessive requests may lead to temporary or permanent blocking. Refer to the official [Flickr API documentation](https://www.flickr.com/services/developer/api/) for detailed usage guidelines.
Example command to download 10 images matching 'honeybees on flowers':
```bash
python3 flickr_scraper.py --search 'honeybees on flowers' --n 10 --download
```You should see output indicating the download progress:
```plaintext
0/10 https://live.staticflickr.com/21/38596887_40df118fd9_o.jpg
...
9/10 https://live.staticflickr.com/1770/43276172331_e779b8c161_o.jpg
Done. (4.1s)
All images saved to /Users/glennjocher/PycharmProjects/flickr_scraper/images/honeybees_on_flowers/
```The downloaded images will be available in the specified folder (e.g., `images/honeybees_on_flowers/`), ready for annotation, further processing, or direct use in training your models.
## đ Citation
If the Flickr Scraper tool helps your research or work, please consider citing it using the following DOI:
[](https://zenodo.org/badge/latestdoi/242235660)
## đ¤ Contributing
Contributions are welcome! We value input from the community to fix bugs, add features, or improve documentation. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how to get started. Don't forget to share your experiences and feedback by completing our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). Thank you đ to all our contributors!
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
## ÂŠī¸ License
Ultralytics provides two licensing options for this project:
- **AGPL-3.0 License**: An [OSI-approved open-source license](https://opensource.org/license/agpl-v3), ideal for students and enthusiasts who wish to contribute and share improvements publicly. See the [LICENSE](https://github.com/ultralytics/flickr_scraper/blob/main/LICENSE) file for details.
- **Enterprise License**: Designed for commercial applications, this license allows for the integration of Ultralytics software and AI models into commercial products and services without the open-source requirements of AGPL-3.0. If your use case involves commercial deployment, please contact us through [Ultralytics Licensing](https://www.ultralytics.com/license).## đŦ Contact
For bug reports, feature suggestions, or contributions, please visit [GitHub Issues](https://github.com/ultralytics/flickr_scraper/issues). For broader questions and discussions about Ultralytics projects, join our active community on [Discord](https://discord.com/invite/ultralytics)! Explore the full range of our resources at [Ultralytics Docs](https://docs.ultralytics.com/).