/laravel-serpstack

A Laravel package to retrieve SERP results from Serpstack https://serpstack.com/

Primary LanguagePHPMIT LicenseMIT

Serpstack Laravel API Client

Laravel package for the Serpstack API.

Getting Started

Run the following command to install this package into your project.

composer require wdevs/laravel-serpstack

Optional: publish the config files with the following command:

php artisan vendor:publish --provider="WDevs\LaravelSerpstack\Providers\LaravelSerpstackServiceProvider"

Set the environment variables in your .env file like this:

SERPSTACK_API_KEY="YOURAPIKEY"
SERPSTACK_SECURE="true"

Prerequisites

You will need Composer to install this package and a valid Serpstack API key.

Installing

After installing this package with Composer, create a new Serpstack instance. And set the your Serpstack API key in your env file.

Something like this:

$client = new LaravelSerpstack();

And call the desired endpoint

$client->search()->searchFor('mcdonalds');

The current implemented endpoints are:

  • GET /search
  • GET /locations

Documentation for the available parameters can be found here: https://serpstack.com/documentation

Running the tests

Copy the phpunit.xml.dist and rename it to phpunit.xml. Set the env variables in the phpunit.xml files.

PLEASE NOTE: running the tests will cost you credits!!!!

  • SERPSTACK_API_KEY: A valid Serpstack access key
  • SERPSTACK_SECURE : True for calling the API over HTTPS

Please see the phpunit.xml.dist for the template.

Run the tests in the Tests directory with PHPUnit.

Built With

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please help us to develop this package. Every input and/or feedback is really appreciated! Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email us instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.