{"id":17676610,"url":"https://github.com/yoannchb-pro/google-img-scrap","last_synced_at":"2025-05-01T00:55:22.764Z","repository":{"id":39494766,"uuid":"442310739","full_name":"yoannchb-pro/google-img-scrap","owner":"yoannchb-pro","description":"Scrap images from google images with customs pre filled google dork options","archived":false,"fork":false,"pushed_at":"2025-04-03T16:24:11.000Z","size":1280,"stargazers_count":19,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-01T00:55:14.256Z","etag":null,"topics":["dork","google","google-dorks","google-image-search","google-images","image","inverse-search","options","query","scraper"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yoannchb-pro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-12-28T00:55:03.000Z","updated_at":"2025-02-17T21:44:22.000Z","dependencies_parsed_at":"2024-06-18T22:58:43.099Z","dependency_job_id":"87efdcf5-dc4d-46ba-a42c-cfc00d9d8cf6","html_url":"https://github.com/yoannchb-pro/google-img-scrap","commit_stats":{"total_commits":25,"total_committers":4,"mean_commits":6.25,"dds":0.56,"last_synced_commit":"f60ee86a96b41a6f849d08cf9d622ee248cccebb"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchb-pro%2Fgoogle-img-scrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchb-pro%2Fgoogle-img-scrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchb-pro%2Fgoogle-img-scrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchb-pro%2Fgoogle-img-scrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoannchb-pro","download_url":"https://codeload.github.com/yoannchb-pro/google-img-scrap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251806210,"owners_count":21646843,"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","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":["dork","google","google-dorks","google-image-search","google-images","image","inverse-search","options","query","scraper"],"created_at":"2024-10-24T07:26:12.310Z","updated_at":"2025-05-01T00:55:22.745Z","avatar_url":"https://github.com/yoannchb-pro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google-img-scrap\n\nScrap images from google images with customs pre filled dorking options\n\n## Update\n\n- See [changelog](CHANGELOG.md)\n\n## Found a bug ?\n\n- Tell it in my github issues dont be afraid :)\n\n## Installation\n\n```\nnpm i google-img-scrap\n```\n\n## Import\n\n```js\nconst {\n  GOOGLE_IMG_SCRAP,\n  GOOGLE_IMG_INVERSE_ENGINE_URL,\n  GOOGLE_IMG_INVERSE_ENGINE_UPLOAD,\n  GOOGLE_QUERY\n} = require('google-img-scrap');\n// OR\nimport {\n  GOOGLE_IMG_SCRAP,\n  GOOGLE_IMG_INVERSE_ENGINE_URL,\n  GOOGLE_IMG_INVERSE_ENGINE_UPLOAD,\n  GOOGLE_QUERY\n} from 'google-img-scrap';\n```\n\n## Options definition\n\n- \"search\" `string` what you want to search\n- \"proxy\" `AxiosProxyConfig` configure a proxy with axios proxy\n- \"excludeWords\" `string[]` exclude some words from the search\n- \"domains\" `string[]` filter by domains\n- \"excludeDomains\" `string[]` exclude some domains\n- \"safeSearch\" `boolean` active safe search or not for nsfw for example\n- \"custom\" `string` add extra query\n- \"urlMatch\" `string[][]` get image when an url match a string (example: \"cdn\") | `example below`\n- \"filterByTitles\" `string[][]` filter images by titles | `example below`\n- \"query\" `GoogleQuery` set a query (can be [TYPE, DATE, COLOR, SIZE, LICENCE, EXTENSION]) (use GOOGLE_QUERY items | `example below`\n- \"limit\" `number` to limit the size of the results\n\n## Result\n\n```js\n{\n  url: 'https://images.google.com/search?tbm=isch\u0026tbs=\u0026q=cats',\n  search: \"cats\",\n  result: [\n    {\n      id: 'K6Qd9XWnQFQCoM',\n      title: 'Domestic cat',\n      url: 'https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_2x1.jpg',\n      originalUrl: 'https://www.nationalgeographic.com/animals/mammals/facts/domestic-cat',\n      height: 1536,\n      width: 3072\n    },\n    {\n      id: 'HkevFQZ5DYu7oM',\n      title: 'Cat - Wikipedia',\n      url: 'https://upload.wikimedia.org/wikipedia/commons/1/15/Cat_August_2010-4.jpg',\n      originalUrl: 'https://en.wikipedia.org/wiki/Cat',\n      height: 2226,\n      width: 3640\n    },\n    ...\n  ]\n}\n```\n\n## How to use ?\n\n## Simple example\n\nSearch cats images\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats'\n});\n\nconsole.log(test);\n```\n\n## Reverse search engine\n\nThe second parameter is like GOOGLE_IMG_SCRAP it include all type of options omitting search. (Omit\u003cConfig, \"search\"\u003e)\n\n### With an url (cost: 2 request)\n\n```js\nconst test = await GOOGLE_IMG_INVERSE_ENGINE_URL(\n  'https://upload.wikimedia.org/wikipedia/commons/1/15/Cat_August_2010-4.jpg',\n  { limit: 5 }\n);\n\nconsole.log(test);\n```\n\n### With a local image (cost: 3 request)\n\n```js\nconst imageBuffer = fs.readFileSync('demonSlayer.png');\nconst test = await GOOGLE_IMG_INVERSE_ENGINE_UPLOAD(imageBuffer, {\n  limit: 5\n});\n\nconsole.log(test);\n```\n\n## Custom query\n\nAll query options are optional (see below for all the options) and need to be in uppercase. You can combine as much as you want.\nFind all possible query options below.\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  query: {\n    TYPE: GOOGLE_QUERY.TYPE.CLIPART,\n    LICENCE: GOOGLE_QUERY.LICENCE.COMMERCIAL_AND_OTHER,\n    EXTENSION: GOOGLE_QUERY.EXTENSION.JPG\n  }\n});\n\nconsole.log(test);\n```\n\n## Limit result size\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  limit: 5\n});\n\nconsole.log(test);\n```\n\n## Proxy\n\nSee axios documentation to setup the proxy\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  proxy: {\n    protocol: 'https',\n    host: 'example.com',\n    port: 8080\n  }\n});\n\nconsole.log(test);\n```\n\n## Domains\n\nOnly scrap from a specific domain\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  domains: ['alamy.com', 'istockphoto.com', 'vecteezy.com']\n});\n\nconsole.log(test);\n```\n\n## Exclude domains\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  excludeDomains: ['istockphoto.com', 'alamy.com']\n});\n\nconsole.log(test);\n```\n\n## Exclude words\n\nIf you don' like black cats and white cats\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  excludeWords: ['black', 'white'] //If you don't like black cats and white cats\n});\n\nconsole.log(test);\n```\n\n## Safe search (no nsfw)\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  safeSearch: false\n});\n\nconsole.log(test);\n```\n\n## Custom query params\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  custom: 'name=content\u0026name2=content2'\n});\n\nconsole.log(test);\n```\n\n## How urlMatch and filterByTitles work ?\n\n```js\nconst test = await GOOGLE_IMG_SCRAP({\n  search: 'cats',\n  //will build something like this \"(draw and white) or (albino and white)\"\n  filterByTitles: [\n    ['draw', 'white'],\n    ['albino', 'white']\n  ],\n  //will build something like this \"(cdn and wikipedia) or (cdn istockphoto)\"\n  urlMatch: [\n    ['cdn', 'wikipedia'],\n    ['cdn', 'istockphoto']\n  ]\n});\n\nconsole.log(test);\n```\n\n## Google query\n\n```js\n{\n  SIZE: {\n    LARGE,\n    MEDIUM,\n    ICON\n  },\n  COLOR: {\n    BLACK_AND_WHITE,\n    TRANSPARENT,\n    RED,\n    BLUE,\n    PURPLE,\n    ORANGE,\n    YELLOW,\n    GREEN,\n    TEAL,\n    PINK,\n    WHITE,\n    GRAY,\n    BLACK,\n    BROWN\n  },\n  TYPE: {\n    CLIPART,\n    DRAW,\n    GIF\n  },\n  EXTENSION: {\n    JPG,\n    GIF,\n    BMP,\n    PNG,\n    SVG,\n    WEBP,\n    ICO,\n    RAW\n  },\n  DATE: {\n    DAY,\n    WEEK,\n    MONTH,\n    YEAR\n  },\n  LICENCE: {\n    CREATIVE_COMMONS,\n    COMMERCIAL_AND_OTHER\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoannchb-pro%2Fgoogle-img-scrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoannchb-pro%2Fgoogle-img-scrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoannchb-pro%2Fgoogle-img-scrap/lists"}