dexiio/dexi-api-client
Composer 安装命令:
composer require dexiio/dexi-api-client
包简介
Dexi API Client for PHP 5.3+
README 文档
README
dexi-php-client
Dexi API Client for PHP 5.3+
Installation
dexi-php-client is available via composer/packagist as dexi-api-client. Install it by adding it to your composer.json file:
"dexiio/dexi-api-client": "~1.1"
or
composer require dexiio/dexi-api-client
Example
The following example executes a run and retrieves information for the execution:
<?php
// Load using the composer autoloader to handle our PSR-4 namespacing
require __DIR__ . '/vendor/autoload.php';
define('CS_API_KEY', 'Your secret API Key'); // See https://app.dexi.io/#/api
define('CS_ACCOUNT_ID', 'Your account ID');
$someRunId = '59f3822f-6abc-4a01-81dc-5002a31f2dbc'; // Edit your runs inside the app to get their ID
\Dexi\Dexi::init(CS_API_KEY, CS_ACCOUNT_ID);
$newExecution = \Dexi\Dexi::runs()->execute($someRunId);
var_dump($newExecution);
Documentation
See the API documentation for details on all namespaces, methods and models. The global API object must be initialized in order to be used:
\Dexi\Dexi::init(<your api key>, <your account id>);
The following API namespaces are contained in the global Dexi\Dexi class:
\Dexi\Dexi::executions()
\Dexi\Dexi::runs()
\Dexi\Dexi::robots()
\Dexi\Dexi::dataSets()
These namespaces contain the methods displayed in the API documentation. Models are defined in the \Dexi\DTO\ namespace.
Migrating from cloudscrape-client-php
Github: cloudscrape/cloudscrape-client-php is now dexiio/dexi-php-client
Packagist: cloudscrape/cloudscrape-api-client is now dexiio/dexi-api-client
If you are currently using cloudscrape-client-php, we strongly suggest you upgrade to this library as cloudscrape-client-php has been deprecated and will no longer be developed, and may not be supported in the future. Most method signatures have changed and we have added PSR-4 namespacing and rebranding to the Dexi name, as well as moving to support PHP7. New classes and methods have also been added.
| Old class | New class |
|---|---|
| CloudScrape | \Dexi\Dexi |
| CloudScrapeClient | \Dexi\Client |
| CloudScrapeExecutions | \Dexi\Executions |
| CloudScrapeRuns | \Dexi\Runs |
| \Dexi\Robots | |
| \Dexi\DataSets | |
| CloudScrapeRunDTO | \Dexi\DTO\RunDTO |
| \Dexi\DTO\RunListDTO | |
| CloudScrapeResultDTO | \Dexi\DTO\ResultDTO |
| CloudScrapeFileDTO | \Dexi\DTO\FileDTO |
| CloudScrapeExecutionDTO | \Dexi\DTO\ExecutionDTO |
| CloudScrapeExecutionListDTO | \Dexi\DTO\ExecutionListDTO |
| \Dexi\DTO\StatsDTO | |
| \Dexi\DTO\RobotDTO | |
| \Dexi\DTO\DataSetRowSetDTO | |
| \Dexi\DTO\DataSetRowQueryDTO | |
| CloudScrapeRequestException | \Dexi\Exception\RequestException |
Testing
PHPUnit integration tests are provided in the test/Dexi folder. In order to run them, a configuration.ini file
must be created in the top-level folder with the following settings:
[tests]
apiKey=<a valid api key>
accountId=<your account id>
# Optional fields
categoryId=<if set, will store created resources in this folder>
dataSetId=<if set, provides data set tests using this data set>
Contributing
Please submit bug reports, suggestions and pull requests to through Github.
We are more than happy to examine any pull-requests and appreciate any ideas, comments or suggestions you may have.
License
The library is available as open source under the terms of the MIT License.
dexiio/dexi-api-client 适用场景与选型建议
dexiio/dexi-api-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.47k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「crawling」 「scraping」 「extracting」 「cloudscrape」 「dexi」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dexiio/dexi-api-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dexiio/dexi-api-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dexiio/dexi-api-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP library for unlock contents from various files with ease.
A lightweight, dependency free PHP class that acts as wrapper for Crawlbase API
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content (forked from Cyber-Duck/Silverstripe-SEO)
Crawlzone is a fast asynchronous internet crawling framework aiming to provide open source web search and testing solution. It can be used for a wide range of purposes, from extracting and indexing structured data to monitoring and automated testing.
TYPO3 extension for generating .well-known/llm.txt links according to llmstxt.org specification
PHP SDK for the Firecrawl v2 API with Laravel support
统计信息
- 总下载量: 10.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-22