[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
 
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
Thanks Zeus! Managed to get it working with your advice. :beer:

***Resolved!***
 

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