Connectors

Download the connectors from GitHub

Majestic provides a set of connectors that have been designed to ease integration with our API. We currently provide implementations in C#, Java, Perl, PHP, Python and Ruby - all of which ship with working examples.

Take a look at our GitHub account for packages containing the source, binaries (where applicable) and working examples using both authentication protocols.

Overview

The connector API abstracts the technical details of request encoding, command execution and interpreting the response and provides a simple interface, allowing you to focus on what you want to do with the data.

To maximise your connector experience, please study the documentation which outlines the connector API in a language-agnostic fashion. This should furnish you with all you need to interact in full with the Majestic SEO API response.

Example

Below is an example demonstrating how to retrieve the top 100 backlinks to majestic.com, using the Java connector and the Internal/Reseller authentication protocol. For details on how to use the OpenApps authentication protocol, please see the Authentication section in the API reference guide.

APIService api = new APIService("MY_API_KEY", "https://api.majestic.com/api_command");

Map<String, String> parameters = new HashMap();
parameters.put("items", "1");
parameters.put("item0", "majestic.com");

Response response = api.executeCommand("GetIndexItemInfo", parameters);

if(response.isOK()){
  DataTable dataTable = response.getTableForName("Results");
  List<Map<String, String>> rows = dataTable.getTableRows();
  Map result = rows.get(0);

  System.out.println(result.get("ExtBackLinks"));
}
else{
  System.out.println(response.getErrorMessage());
}