What's the best way to make API bots ?

tounsi7orr

BANNED
Joined
Apr 21, 2014
Messages
180
Reaction score
13
Hello !
I need to make an API bot with python or c#. But I'm confused what librairie should I use. I used to make browser bots using selenium and python but sadly selenium dosent supports API as I know. What about phantomjs ? Is it good ?
 
If you use python, you can use the build in module urllib2 for http api calls
 
not sure about bot you want.. for me if want post.. i use request

import requests
response = requests.post('https://balbla.bla/api/mobile', headers=headers, data=data)

if want get just change requests.get
 
PhantomJS is amazing, you can also try CasperJS, some people prefer it, sometimes using CasperJS is much simpler than PhantomJS.
 
You don't need any libraries for C#. You just need the HTTPWebRequest feature which is already built in .NET Framework. Just learn about POST and GET data, it's easy!
 
Back
Top