1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What's the best way to make API bots ?

Discussion in 'Programming' started by tounsi7orr, Mar 3, 2017.

  1. tounsi7orr

    tounsi7orr BANNED BANNED

    Joined:
    Apr 21, 2014
    Messages:
    180
    Likes Received:
    11
    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 ?
     
  2. RichardDay

    RichardDay Registered Member

    Joined:
    Feb 9, 2017
    Messages:
    94
    Likes Received:
    25
    Gender:
    Male
    Phantom JS is good, c# has a library for it too :)
     
  3. Dayfuse

    Dayfuse Newbie

    Joined:
    Dec 4, 2016
    Messages:
    19
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Europe
    Home Page:
    If you use python, you can use the build in module urllib2 for http api calls
     
  4. GoDesain

    GoDesain Regular Member

    Joined:
    Feb 26, 2011
    Messages:
    444
    Likes Received:
    132
    Home Page:
    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
     
  5. epagos

    epagos Newbie

    Joined:
    Apr 11, 2007
    Messages:
    22
    Likes Received:
    1
    PhantomJS is amazing, you can also try CasperJS, some people prefer it, sometimes using CasperJS is much simpler than PhantomJS.
     
  6. Netro

    Netro Junior Member

    Joined:
    Jun 12, 2015
    Messages:
    107
    Likes Received:
    27
    Occupation:
    Baka Dev.
    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!