承接 marketingtoolbox/dataforseo-php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

marketingtoolbox/dataforseo-php-sdk

最新稳定版本:0.1.0

Composer 安装命令:

composer require marketingtoolbox/dataforseo-php-sdk

包简介

PHP library for the DataForSEO API

README 文档

README

Latest Version Software License Build Status Code Coverage Mutation testing

Installation

composer require marketingtoolbox/dataforseo-php-sdk

Usage

Here's an example of how to use the library with the SERP > Google > Organic endpoint:

<?php
use MarketingToolbox\DataForSEO\Request;
use MarketingToolbox\DataForSEO\Response;

// Let's start by initializing the client
$client = new MarketingToolbox\DataForSEO\Client\Client('your_login', 'your_password');

// Now we can use the client to make requests
// Notice that the request objects' namespaces are similar to the API endpoints

/** @var Response\Serp\Google\Organic\TaskPostResponse $response */
$response = $client->request(new Request\Serp\Google\Organic\TaskPostRequest(
    // In the first request we use the pingback url to get notified when the task is finished.
    // The PingbackUrl value object will create a pingback url including the id and tag query parameters 
    new Request\Serp\Google\Organic\TaskPostRequestData('bikes', 'United States', 'en', 'your_tag', pingbackUrl: (string) new Request\PingbackUrl('https://your-pingback-url.com')),
    new Request\Serp\Google\Organic\TaskPostRequestData('cars', 'United States', 'en'),
));

/** @var Response\Serp\Google\Organic\TaskPostResponseTask $task */
foreach ($response->tasks as $task) {
    // iterate over each task
}

// You can also find a task by the tag you provided when you created it

/** @var Response\Serp\Google\Organic\TaskPostResponseTask|null $task */
$task = $response->findTaskByTag('your_tag');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-28