jaybizzle/rankinity-api

A simple PHP wrapper for the Rankinity API

v1.0.0 2016-03-02 22:28 UTC

This package is auto-updated.

Last update: 2024-11-06 09:19:58 UTC


README

Build Status StyleCI Total Downloads

Installation

Add "jaybizzle/rankinity-api": "1.*" to your composer.json.

Usage

You can read the official Rankinity API documention here - http://my.rankinity.com/api.en

All the Rankinity API endpoints can be called by prefixing the name with get e.g

use Jaybizzle\Rankinity;

$r = new Rankinity('YOUR_API_KEY');

// get all projects
$projects = $r->getProjects();

Most Rankinity API endpoints can accept query string parameters, such as sort_property to sort the results returned. Taking the above projects example, we can simply do this...

$projects = $r->sortProperty('name')->getProjects();

These can also be chained...

$projects = $r->sortProperty('name')->sortAscending('false')->getProjects();

Some more examples...

//  list of competitors
$competitors = $r->project('project_id')->getCompetitors();

// list of keywords
$keywords = $r->project('project_id')->getKeywords();

// list of keyword groups
$groups = $r->project('project_id')->getGroups();

// list of ranks
$ranks = $r->project('project_id')->searchEngine('search_engine_id')->getRanks();

NOTE: Query parameters are listed in the Rankinity API docs as snake_case but we access them using camelCase methods so all method calls have a consistent naming convention