Start a new topic
Answered

Getting jobs list for organization through API

 Hi!

I actually didn't find this in the API reference or API documentation: how can I get list of the jobs for the particular organization?


I'm looking for something like this:

$ curl -u APIKEY "https://app.scrapinghub.com/api/list.json?organization=123"


Thank you!


Best Answer

Hello Juisaeva,


Please see  python-scrapinghub client library. This can be used to get the list of Projects and then iterate over them to get the list of spiders and get Items.


Regards,

Thriveni 


Yes, that's helped. We can get the list of projects for APIkey at least. Not for organization, but that's much better than before. Thanks!

 

Answer

Hello Juisaeva,


Please see  python-scrapinghub client library. This can be used to get the list of Projects and then iterate over them to get the list of spiders and get Items.


Regards,

Thriveni 


1 person likes this

E.g. I have something like this:

Org1:

project 123 (spiders: ''aaa', 'bbb'), project 124(spders:"ccc", "ddd"), project 125  (spiders: "eee")

Org2:

project 222 (spiders: 'xxx', 'yyy'), project 333 (spiders: ''zzz', 'www'), project 444 (spiders: 'qqq'")


I need to get from the request result xxx, yyy, zzz, www, qqq

Or at least numbers of the projects: 222, 333, 444 (I don't want to specify them manually in my curl-request), for iterating over them to get the list of spiders\jobs.



Hi Juisaeva,


Please check this documentation: https://doc.scrapinghub.com/api/jobs.html#jobs-list-json-jl


I hope this helps.


Best,


Pablo

Login to post a comment