outscraper php
v4.0.0
该库提供从 PHP 语言编写的应用程序对 Outscraper API 的便捷访问。允许通过您的代码使用 Outscraper 的服务。
API文档
您可以通过 Composer 安装绑定。运行以下命令:
composer require outscraper/outscraper
要使用绑定,请使用 Composer 的自动加载:
require_once ( ' vendor/autoload.php ' );
如果您不想使用 Composer,可以下载最新版本。然后,要使用绑定,请包含init.php
文件。
require_once ( ' /path/to/outscraper-php/init.php ' );
链接到 PHP 包页面
$ client = new OutscraperClient ( " SECRET_API_KEY " );
链接到配置文件页面以创建 API 密钥
抓取 Google Mpas 结果查询“德国柏林亚洲餐馆”。
$ results = $ client -> google_maps_search ([ ' asian restaurants Berlin, Germany ' ], ' en ' , ' DE ' );
print_r ( $ results );
从自由女神像国家纪念碑上抓取 Google Mpas 评论。
$ results = $ client -> google_maps_reviews ([
' https://www.google.com/maps/place/Statue+of+Liberty+National+Monument/@40.6892494,-74.0466891,17z/data=!3m1!4b1!4m5!3m4!1s0x89c25090129c363d:0x40c6a5770d25022b!8m2!3d40.6892494!4d-74.0445004 '
], limit: 10 , sort: ' newest ' );
// you can use direct links, IDs, or names as input for query
print_r ( $ results );
从域中抓取电子邮件和联系人。
$ results = $ client -> emails_and_contacts ([
' outscraper.com '
]);
print_r ( $ results );
更多示例
欢迎在 GitHub 上提交错误报告和拉取请求:https://github.com/outscraper/outscraper-php。