{"id":19283726,"url":"https://github.com/commonkestrel/image_search","last_synced_at":"2025-08-26T03:08:49.840Z","repository":{"id":64767201,"uuid":"569139389","full_name":"commonkestrel/image_search","owner":"commonkestrel","description":"A crate used to search Google Images based on provided arguments.","archived":false,"fork":false,"pushed_at":"2024-04-11T05:48:55.000Z","size":257,"stargazers_count":5,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T21:54:09.878Z","etag":null,"topics":["google","google-image-search","google-images","images"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commonkestrel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-22T06:58:37.000Z","updated_at":"2023-12-11T02:01:46.000Z","dependencies_parsed_at":"2024-04-09T18:25:23.321Z","dependency_job_id":"b79a58f2-64d2-4f40-99a4-f8310ebe0175","html_url":"https://github.com/commonkestrel/image_search","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.02083333333333337,"last_synced_commit":"fbc080d50a3cef06e7b6ff737ab2dc24b8392b47"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/commonkestrel/image_search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonkestrel%2Fimage_search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonkestrel%2Fimage_search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonkestrel%2Fimage_search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonkestrel%2Fimage_search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commonkestrel","download_url":"https://codeload.github.com/commonkestrel/image_search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonkestrel%2Fimage_search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272164960,"owners_count":24884626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google","google-image-search","google-images","images"],"created_at":"2024-11-09T21:34:46.007Z","updated_at":"2025-08-26T03:08:49.763Z","avatar_url":"https://github.com/commonkestrel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/commonkestrel/image_search/master/misc/logo-black.png\" width=640px\u003e\u003c/div\u003e\n\n# Google Image Search\n![Crates.io](https://img.shields.io/crates/v/image_search) ![docs.rs](https://img.shields.io/docsrs/image_search) ![Crates.io](https://img.shields.io/crates/l/image_search)\n\nA crate designed to search Google Images based on provided arguments.\nDue to the limitations of using only a single request to fetch images, only a max of about 100 images can be found per request.\nThese images may be protected under copyright, and you shouldn't do anything punishable with them, like using them for commercial use.\n\n# Arguments\n\nThere are 2 required parameters, along with a variety of different arguments.\n| Argument | Type | Description |\n| --- | --- | --- |\n| **query** | `\u0026str` | The keyword(s) to search for.  |\n| **limit** | `usize` | The maximum amount of images to fetch. Cannot fetch more than 100. |  \n| **thumbnails** | `bool` | Causes the `urls` and `downloads` functions to use the urls of the thumbnails instead of the urls of the images. |\n| **timeout** | [`Option\u003cDuration\u003e`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html) | Sets the timeout for the `download` function. Setting to `None` is not recommended, since in rare cases images can fail to download but not throw an error, causing the `download` function to never return. |\n| **directory** | [`Option\u003cPathBuf\u003e`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html) |  |\n\n## Search Arguments\n\nThese are optional arguments that Google can use to filter images, useful for narrowing your search.\nThey are used via the various methods on the `Arguments` struct. Each argument is contained in an `enum` which contains all possible options.\n\n| Argument | Options | Description |\n| --- | --- | --- |\n| **Color** | `Red`, `Orange`, `Yellow`, `Green`, `Teal`, `Blue`, `Purple`, `Pink`, `White`, `Gray`, `Black`, `Brown` | Filter images by the dominant color. |\n| **ColorType** | `Color`, `Grayscale`, `Transparent` | Filter images by the color type. |\n| **License** | `CreativeCommons`, `Other` | Filter images by the usage license. |\n| **Type** | `Face`, `Photo`, `Clipart`, `Lineart`, `Animated` | Filters by the type of images to search for. |\n| **Time** | `Day`, `Week`, `Month`, `Year` | Only finds images posted in the time specified. |\n| **AspectRatio** | `Tall`, `Square`, `Wide`, `Panoramic` | Specifies the aspect ratio of the images. |\n| **Format** | `Jpg`, `Gif`, `Png`, `Bmp`, `Svg`, `Webp`, `Ico`, `Raw` | Filters out images that are not a specified format. If you would like to download images as a specific format, use the download_format argument instead. |\n\n# Examples\nUsing the asynchronous API requires some sort of async runtime, usually [`tokio`](https://crates.io/crates/tokio), which can be added to your `Cargo.toml` like so:\n```toml\n[dependencies]\nimage_search = \"0.4\"\ntokio = { version = \"1\", features = [\"full\"] }\n```\nIt can be used like this:\n```rust\nextern crate tokio;\nextern crate image_search;\n\nuse std::path::PathBuf;\nuse image_search::{Arguments, Color, urls, search, download};\n \n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), image_search::Error\u003e {\n    let args = Arguments::new(\"example\", 10)\n        .color(Color::Gray)\n        .directory(PathBuf::from(\"downloads\")); // Only affects the download function\n     \n    let _image_urls = urls(args.clone()).await?;\n    let _images = search(args.clone()).await?;\n    let _paths = download(args).await?;\n \n    Ok(())\n}\n```\n\n# Blocking\nThere is an optional \"blocking\" API that can be enabled:\n```toml\n[dependencies]\nimage_search = { version = \"0.4\", features = [\"blocking\"] }\n```\nThis is called like so:\n```rust\nextern crate image_search;\n\nuse std::path::PathBuf;\nuse image_search::{Arguments, Time, blocking::{urls, search, download}};\n\nfn main() -\u003e Result\u003c(), image_search::Error\u003e {\n    let args = Arguments::new(\"example\", 10)\n        .time(Time::Month)\n        .directory(PathBuf::from(\"downloads\")); // Only affects the download function\n    \n    let _image_urls = urls(args.clone())?;\n    let _images = search(args.clone())?;\n    let _paths = download(args)?;\n\n    Ok(())\n}\n```\n\n# Clients\nThis crate uses [`surf`](https://crates.io/crates/surf) for HTTP requests in order to allow for the customization of the client used for HTTP requests.\nThis can allow programs to interface with C via CURL, pure Rust via [`hyper`](https://crates.io/crates/hyper) or [`async-h1`](https://crates.io/crates/async-h1), or even WASM.\nAs with [`surf`](https://crates.io/crates/surf), the client used can be customized via features.\nIn order to change you will have to set `default-features=false` in your Cargo.toml, since `curl` is used by default.\nThe possible backends are listed here:\n- **`curl`**: Uses `CURL` through `isahc` as the HTTP backend.\n- **`hyper` (default)**: Uses `hyper` as the HTTP backend.\n- **`wasm`**: Uses `window.fetch` as the HTTP backend.\n- **`h1`**: Uses `async-h1` as the HTTP backend with native TLS for HTTPS.\n- **`rustls`**: Uses `async-h1` as the HTTP backend with `rustls` for HTTPS.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonkestrel%2Fimage_search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommonkestrel%2Fimage_search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonkestrel%2Fimage_search/lists"}