定制 resilientlink/resilientlink-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

resilientlink/resilientlink-php

Composer 安装命令:

composer require resilientlink/resilientlink-php

包简介

Official PHP SDK for the ResilientLink Web Scraping API

README 文档

README

Official PHP client for the ResilientLink Web Scraping API.

Requirements

  • PHP >= 7.4
  • ext-curl
  • ext-json

Installation

composer require resilientlink/resilientlink-php

Quick Start

<?php
require 'vendor/autoload.php';

$client = new \ResilientLink\Client(['api_key' => 'YOUR_API_KEY']);

$result = $client->scrape('https://example.com');

echo $result['data']['title'];        // "Example Domain"
echo $result['data']['description'];  // meta description
echo $result['data']['image'];        // OG image URL

Options

$result = $client->scrape('https://example.com', [
    'return_html'       => true,      // include raw HTML
    'screenshot'        => true,      // base64 PNG (Pro/Enterprise)
    'pdf'               => true,      // base64 PDF (Pro/Enterprise)
    'pdf_format'        => 'A4',
    'bypass_cache'      => true,      // force fresh scrape
    'js_render'         => true,      // JS rendering (Pro/Enterprise)
    'wait_for_selector' => '#app',    // wait for CSS selector
    'wait_ms'           => 2000,      // wait 2s before scraping
    'custom_headers'    => ['Accept-Language' => 'en-US'],
    'timeout'           => 30000,     // ms (max 60000)
]);

Response

[
  'success'      => true,
  'cached'       => false,
  'tier'         => '...',
  'responseTime' => 412,
  'data'         => [
    'url'         => 'https://example.com',
    'title'       => 'Example Domain',
    'description' => '...',
    'image'       => '...',
    'domain'      => 'example.com',
    'og'          => ['title' => '...', 'description' => '...'],
    'content'     => ['wordCount' => 423, 'readTimeMinutes' => 2],
    'seo'         => ['keywords' => '...', 'robots' => '...'],
    'scrapedAt'   => '2026-...',
  ]
]

Error Handling

use ResilientLink\ResilientLinkException;

try {
    $result = $client->scrape('https://example.com');
} catch (ResilientLinkException $e) {
    echo $e->getMessage();    // human-readable error
    echo $e->getStatusCode(); // 429 = rate limit, 401 = bad key
    print_r($e->getBody());   // full response body
} catch (\InvalidArgumentException $e) {
    echo $e->getMessage();
}

Get Your API Key

Sign up at resilientlink → Dashboard → API Key.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固