定制 gboquizosanchez/screenscraper 二次开发

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

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

gboquizosanchez/screenscraper

最新稳定版本:1.1.0

Composer 安装命令:

composer require gboquizosanchez/screenscraper

包简介

Laravel wrapper for ScreenScraper API

README 文档

README

ScreenScraper

gboquizosanchez/screenscraper

ScreenScraper.fr API client for Laravel

Latest Stable Version Total Downloads PHP Laravel License: MIT

Fetch game metadata, media, and platform data from ScreenScraper.fr directly in your Laravel app.

Overview

A Laravel package that wraps the full ScreenScraper API, giving you access to game info, artwork, ratings, and more — with optional DTO mapping via spatie/laravel-data.

Note: You need a ScreenScraper account and developer credentials to use this package. Register here and request developer access here.

📦 Installation

composer require gboquizosanchez/screenscraper

Add your credentials to .env:

SCREENSCRAPER_BASE_URL=https://api.screenscraper.fr/api2/
SCREENSCRAPER_OUTPUT=json
SCREENSCRAPER_USERNAME=your_username
SCREENSCRAPER_PASSWORD=your_password
SCREENSCRAPER_DEV_ID=your_dev_id
SCREENSCRAPER_DEV_PASSWORD=your_dev_password
SCREENSCRAPER_SOFTNAME="ScreenScraper API Client for Laravel"
SCREENSCRAPER_DTO_MAPPING=true
SCREENSCRAPER_RAW_MAPPING=false

Optionally, publish the configuration file:

php artisan vendor:publish --provider="ScreenScraper\ScreenScraperServiceProvider"

🚀 Usage

Via facade

The facade reads credentials directly from your .env:

use ScreenScraper\ScreenScraperClient;

ScreenScraperClient::getGame(gameId: 1);

Via the client directly

Useful when working with multiple accounts or custom credentials:

use ScreenScraper\Data\AuthData;
use ScreenScraper\Models\ScreenScraper;

$auth = new AuthData(
    devId: 'your_dev_id',
    devPassword: 'your_dev_password',
    softname: 'Your App Name',
    output: 'json',
    ssid: 'your_username',
    sspassword: 'your_password',
);

$client = new ScreenScraper($auth);
$client->getGame(gameId: 1);

You can also use the default credentials from config:

$auth = new AuthData(...config('screenscraper.credentials'));

🗺️ Response mapping

By default, the package maps responses to typed DTOs. You can switch to raw responses via .env:

# Default — typed DTOs via spatie/laravel-data
SCREENSCRAPER_DTO_MAPPING=true
SCREENSCRAPER_RAW_MAPPING=false

# Raw responses — disable DTO mapping first
SCREENSCRAPER_DTO_MAPPING=false
SCREENSCRAPER_RAW_MAPPING=true

RAW mapping only works when SCREENSCRAPER_DTO_MAPPING is set to false.

📚 Available methods

This package covers all endpoints from the ScreenScraper API. See ScreenScraperClient for the full method list.

🧪 Testing

composer test

Contributing

Contributions are welcome!

  • 🐛 Report bugs via GitHub Issues
  • 💡 Suggest features or improvements
  • 🔧 Submit pull requests with fixes or enhancements

Credits

📄 License

This package is open-source software licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固