[SOLVED] Using HTTP Post with Ahref's API

shabbysquire

Client
Регистрация
25.11.2012
Сообщения
544
Благодарностей
26
Баллы
28
I'm trying to create a bot that grabs backlink metrics from Ahrefs.com using an API. I don't know if any other ZP gurus use Ahrefs (or any other similar services), but I would appreciate any advice.


So I'm using HTTP Post Request. In the URL field I've inserted:

Код:
http://api.ahrefs.com/get_backlinks_count.php?
and in the data field:

Код:
target={-Variable.url_to_check-}&mode=domain&output=json&AhrefsKey=***API key removed****
(Note: the variable {-Variable.url_to_check-} is just a domain taken from a list).

ahrefs and zenno.JPG

You can see an example query at this page (no 1 example), or screenshot:

ahrefs example query.JPG
 

zeus

Client
Регистрация
03.07.2012
Сообщения
99
Благодарностей
21
Баллы
18
I think this is a GET request and not POST.
Add the full url : i.e
Код:
http://api.ahrefs.com/get_backlinks_count.php?target={-Variable.url_to_check-}&mode=domain&output=json&AhrefsKey=***API key removed****
to the GET request and it should work.
 
  • Спасибо
Реакции: shabbysquire

shabbysquire

Client
Регистрация
25.11.2012
Сообщения
544
Благодарностей
26
Баллы
28
Thanks Zeus! Managed to get it working with your advice. :az:

***Resolved!***
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)