{"id":19435365,"url":"https://github.com/wapnen/google-cloud-vision-php","last_synced_at":"2026-02-27T19:14:45.442Z","repository":{"id":62546581,"uuid":"134960804","full_name":"wapnen/google-cloud-vision-php","owner":"wapnen","description":"A simple php wrapper for the google cloud vision API","archived":false,"fork":false,"pushed_at":"2019-02-26T15:01:30.000Z","size":24,"stargazers_count":19,"open_issues_count":4,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-22T19:29:05.083Z","etag":null,"topics":["face-detection","google-cloud-vision","label-detection","landmark-detection","laravel","logo-detection","ocr","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/wapnen.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}},"created_at":"2018-05-26T12:48:53.000Z","updated_at":"2025-04-17T09:36:19.000Z","dependencies_parsed_at":"2022-11-02T22:15:22.623Z","dependency_job_id":null,"html_url":"https://github.com/wapnen/google-cloud-vision-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wapnen/google-cloud-vision-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapnen%2Fgoogle-cloud-vision-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapnen%2Fgoogle-cloud-vision-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapnen%2Fgoogle-cloud-vision-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapnen%2Fgoogle-cloud-vision-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wapnen","download_url":"https://codeload.github.com/wapnen/google-cloud-vision-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapnen%2Fgoogle-cloud-vision-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29909411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T17:28:36.873Z","status":"ssl_error","status_checked_at":"2026-02-27T17:28:20.970Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["face-detection","google-cloud-vision","label-detection","landmark-detection","laravel","logo-detection","ocr","php"],"created_at":"2024-11-10T15:05:50.980Z","updated_at":"2026-02-27T19:14:45.410Z","avatar_url":"https://github.com/wapnen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# google-cloud-vision-php\n# Overview\n\nPerforms Label detection, face detection, Logo detection, explicit content detection, landmark detection, optical character   recogition and web detection on images.\n  You can read more about Google cloud vision here https://cloud.google.com/vision/\n\n# Getting Started\n  You will need a google account to use this API so if you do not already have an account with google, head over there and create one\n\n## Installation\n  ```bash\ncomposer require wapnen/google-cloud-vision-php\n```\n\n## Enable the API\n  To start using the google cloud vision api, follow the instructions here to enable the api for your google account https://cloud.google.com/vision/docs/before-you-begin\n\n## Authentication\n  You must set up an Api key to authenticate your requests. Follow the instructions here https://support.google.com/cloud/answer/6158862?hl=en to set up an API key for your project on google cloud platform console\n\n# Usage\n```\n\u003c?php\ninclude \"vendor/autoload.php\";\nuse GoogleCloudVision\\GoogleCloudVision;\nuse GoogleCloudVision\\Request\\AnnotateImageRequest;\nuse GoogleCloudVision\\Request\\Request;\n\n\n$annotateImageRequest1 = new AnnotateImageRequest();\n$annotateImageRequest1-\u003esetImageUri(\"https://cdn.pixabay.com/photo/2016/02/19/11/25/supreme-court-building-1209701_960_720.jpg\");\n$annotateImageRequest1-\u003esetFeature('IMAGE_PROPERTIES');\n$annotateImageRequest1-\u003esetFeature('LABEL_DETECTION');\n$annotateImageRequest1-\u003esetFeature('WEB_DETECTION');\n\n$gcvRequest = new GoogleCloudVision([$annotateImageRequest1], \"Your_api_key\");\n$response = $gcvRequest-\u003eannotate();\n\necho json_encode($response);\n\n\n\n ?\u003e\n\n```\nNote : You can create as many as 16 Annotate image requests to be sent with the request object\n\nThe function ```setImageUri();``` takes a Google Cloud Storage image location, or publicly-accessible image URL. Alternatively you can use ```setImage();``` which takes a base64 encoded image string.\n\nYou can set as many features as are available to the annotateImageRequest by calling the ```setFeature();``` function on the annotateImageRequest which takes any of the following enum parameters ; TYPE_UNSPECIFIED, FACE_DETECTION, LANDMARK_DETECTION, LOGO_DETECTION, LABEL_DETECTION, TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, SAFE_SEARCH_DETECTION, IMAGE_PROPERTIES, CROP_HINTS, WEB_DETECTION.\n\nOptionally, you can set the image context for each annotateImageRequest object like so\n```\n$annotateImageRequest1 = new AnnotateImageRequest()\n$annotateImageRequest1-\u003esetImageContext();\n$annotateImageRequest1-\u003egetImageContext()-\u003esetCropHintsParams([1.333]); //array\n$annotateImageRequest1-\u003egetImageContext()-\u003esetWebDetectionParams(false);  //boolean\n$annotateImageRequest1-\u003egetImageContext()-\u003esetLanguageHints([]); //array\n```\nFinally, the GoogleCloudVision request object takes an array of AnnotateImageRequest objects as the first parameter and the api key as the second parameter\n\n### Response object\nIf successful, you will receive a json object response in the format below;\n```\n{\n  \"responses\": [\n    {\n      object(AnnotateImageResponse)\n    }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwapnen%2Fgoogle-cloud-vision-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwapnen%2Fgoogle-cloud-vision-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwapnen%2Fgoogle-cloud-vision-php/lists"}