Skip to content

The C# connector is written using Visual Studio 2019 and targets .NET Standard 2.0

License

Notifications You must be signed in to change notification settings

glienard/Csharp-API-Connector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Majestic API Connector

1 Feb 2020: Gregory Liénard added version in .NET Standard 2.0

The C# connector is written using Visual Studio 2015 and targets .NET Framework 3.5.

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

var parameters = new Dictionary<string, string>()
{
	{"items", "1"},
	{"item0", "majestic.com"}
};

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

if (response.IsOK())
{
	DataTable dataTable = response.GetTableForName("Results");
	List<Dictionary<string, string>> rows = dataTable.GetTableRows();
	Dictionary<string, string> result = rows[0];

	Console.WriteLine(result["ExtBackLinks"]);
}
else
{
	Console.WriteLine(response.GetErrorMessage());
}

A full list of available commands can be found within the developer documentation.

About

The C# connector is written using Visual Studio 2019 and targets .NET Standard 2.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%