n1nj4z33 / iqoptionapi

IQ Option API 4.x (Python 2.7) The project is obsolete and is not supported because of problems with access to IQ Options in Russia
119 stars 539 forks source link

IQ Option login fails #92

Open EVAZA opened 6 years ago

EVAZA commented 6 years ago

Hello, since today the login does not work... how to fix?

suddar commented 6 years ago

Me too, pls help us!

EVAZA commented 6 years ago

It seems the login url changed to: https://auth.iqoption.com/api/v1.0 then we can get ssid. What to do next? How to get the balance?

Salleyi75 commented 6 years ago

I wish I knew how to monitor the request being sent when the app is in use. I would like to take a personal look at the changes, so if anyone can point me in the right direction. @EVAZA how did you know the url has changed to https://auth.iqoption.com/api/v1.0

Lu-Yi-Hsun commented 6 years ago

TRY: https://github.com/Lu-Yi-Hsun/iqoptionapi i fix it

Aleandro21 commented 6 years ago

@EVAZA in which file you need to apply this change, "https://auth.iqoption.com/api/v1.0" . have you tried? it works ?

Aleandro21 commented 6 years ago

you have some fixes ? @EVAZA you have solved, the problem ?

Aleandro21 commented 6 years ago

@Lu-Yi-Hsun i have try your code , but don't login...

Lu-Yi-Hsun commented 6 years ago

@Aleandro21 My fork API NOT support SMS Authorization yet,i suggest close it
because your robot will stop until check sms code(on phone)....

work success 5/3

python 3.6

from iqoptionapi.stable_api import IQ_Option
I_want_money=IQ_Option("email","password")
goal="EURUSD"
print("get candles")
print(I_want_money.get_candles(goal,60,111,time.time()))

iqoption recently updated frequently some api not work... i am hard fixxx

Aleandro21 commented 6 years ago

@Lu-Yi-Hsun i don't hvae a Sms Authorization... how can I see if the sms is active ?

Aleandro21 commented 6 years ago

@EVAZA i have reolved the first step login, i lock on https://iqoption.com/api/getprofile someone has solved ?

Aleandro21 commented 6 years ago

@n1nj4z33 you can help me ?

Lu-Yi-Hsun commented 6 years ago

@Aleandro21 you need to give me log so i can know what happen

Aleandro21 commented 6 years ago

@Lu-Yi-Hsun for n1nj4z33/iqoptionapi i have this error: File "iqoptionapi/api.py", line 293, in connect self.set_session_cookies() File "iqoptionapi/api.py", line 287, in set_session_cookies self.getprofile() # pylint: disable=not-callable File "iqoptionapi/http/getprofile.py", line 24, in call return self._get() File "iqoptionapi/http/getprofile.py", line 17, in _get return self.send_http_request("GET") File "iqoptionapi/http/resource.py", line 25, in send_http_request return self.api.send_http_request(self, method, data=data, params=params, headers=headers) File "iqoptionapi/api.py", line 114, in send_http_request response.raise_for_status() File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://iqoption.com/api/getprofile

for Lu-Yi-Hsun/iqoptionapi i have a loop error:

ERROR:root:error connect() DEBUG:iqoptionapi.api:https://auth.iqoption.com/api/v1.0/login DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"data":{"ssid":"2fb7a685919e539cbaec054b60c54b87"}} DEBUG:iqoptionapi.api:{'Content-Length': '52', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'X-Content-Type-Options': 'nosniff', 'Set-Cookie': 'ssid=2fb7a685919e539cbaec054b60c54b87; Path=/; Domain=iqoption.com; Max-Age=2592000', 'Strict-Transport-Security': 'max-age=15555600', 'Server': 'nginx', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Date': 'Fri, 04 May 2018 07:25:58 GMT', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Content-Type': 'application/json; charset=utf-8'} DEBUG:iqoptionapi.api:<<class 'requests.cookies.RequestsCookieJar'>[<Cookie ssid=2fb7a685919e539cbaec054b60c54b87 for .iqoption.com/>]> DEBUG:iqoptionapi.api:https://iqoption.com/api/getprofile DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"isSuccessful":true,"message":"","result":{"avatar":"","confirmation_required":0,"popup":{"1":{"name":"mobile_firstdeposit first variant Popup","bonus_code":"WelcomeSplashCode2","countdown":40}},"money":{"deposit":{"min":2,"max":1000000},"withdraw":{"min":2,"max":1000000}},"user_group":"Default","welcome_splash":0,"functions":{"is_bonus_block":0,"is_trading_bonus_block":0,"is_vip_mode":0,"is_no_currency_change":0,"popup_ids":["1"],"ext_fields":[]},"finance_state":"","balance":17364.95,"bonus_wager":0,"bonus_total_wager":0,"balance_id":11997994,"balance_type":4,"messages":0,"id":1243758,"demo":0,"public":1,"group_id":1,"name":"name ","nickname":null,"currency":"USD","currency_char":"$","mask":"$%s","city":"city","user_id":1243758,"first_name":"name","last_name":"surname","phone":"phone","email":"email","created":1422026892,"last_visit":1422879185,"site_id":1,"tz":"Europe\/Berlin","locale":"it_IT","birthdate":677376000,"country_id":97,"currency_id":1,"gender":"male","address":"address","postal_index":"cap","timediff":-3600,"tz_offset":120,"balances":[{"id":1415926,"type":1,"amount":680000,"new_amount":680000,"bonus_amount":0,"bonus_total_amount":0,"currency":"EUR","description":null},{"id":16941471,"type":2,"amount":420000,"new_amount":0,"bonus_amount":0,"bonus_total_amount":0,"currency":"USD","description":null},{"id":11997994,"type":4,"amount":17364950000,"new_amount":0,"bonus_amount":0,"bonus_total_amount":0,"currency":"USD","description":null}],"infeed":1,"confirmed_phones":["39 3467319893"],"need_phone_confirmation":false,"rate_in_one_click":true,"deposit_in_one_click":false,"kyc_confirmed":true,"kyc":{"status":3,"isRegulatedUser":true,"isProfileNeeded":true,"isPhoneNeeded":true,"isDocumentsNeeded":true,"isDocumentsDeclined":false,"isProfileFilled":true,"isPhoneFilled":true,"isDocumentsUploaded":true,"isPhoneConfirmationSkipped":false,"isPhoneConfirmed":true,"isDocumentsUploadSkipped":false,"isDocumentsApproved":true,"isDocumentPoiUploaded":true,"isDocumentPoaUploaded":true,"daysLeftToVerify":-1},"trade_restricted":false,"auth_two_factor":null,"deposit_count":13,"is_activated":true,"new_email":"","tc":true,"trial":false,"is_islamic":false,"tin":"","socials":{"4":{"id":"1560793447317643","token":"EAAUMEkYTM0IBAG0TCTbANNS1lPZBYoo6SiEiQn5rnMBsiH8tkNMmRmKsB5nGI9TEmbHFCa0ImA6o2hZAPZC8zWawbRE5lLjw5Hp5xyScYnDPgi6sqIO68onBYlqRT9ZCZBsvb4YaCYgkim14ccezuT5JgVujlluytY1neKLxZBlw58jhAx0htijFzPxFOyYy3kZCquWh3G2owZDZD","group_member_reward":false}},"flag":"IT","cashback_level_info":{"enabled":false},"user_circle":"No exp","skey":"329a744e001e13504900869379584ef3"}} DEBUG:iqoptionapi.api:{'X-Tracing-Key': 'bfaecf28-85a9-46d7-9265-3a7191868386', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'Set-Cookie': 'uat=c9c64e071d2853bc7906c017a231ad1cc46ab630; path=/', 'Strict-Transport-Security': 'max-age=15555600', 'Vary': 'Accept-Encoding', 'Server': 'nginx', 'Connection': 'keep-alive', 'X-Front-Host': 'fe-api-04', 'Access-Control-Allow-Credentials': 'true', 'Date': 'Fri, 04 May 2018 07:25:58 GMT', 'Access-Control-Allow-Origin': 'https://iqoption.com', 'Access-Control-Allow-Headers': 'Content-Type', 'Content-Type': 'application/json; charset=UTF-8'} DEBUG:iqoptionapi.api:<<class 'requests.cookies.RequestsCookieJar'>[<Cookie uat=c9c64e071d2853bc7906c017a231ad1cc46ab630 for iqoption.com/>]> ERROR:root:error connect()

for stop a loop i reboot a server

Lu-Yi-Hsun commented 6 years ago

try update last version

sudo pip3 install -U git+git://github.com/Lu-Yi-Hsun/iqoptionapi.git
Lu-Yi-Hsun commented 6 years ago

i can work
try this sample

from iqoptionapi.stable_api import IQ_Option
import logging
import time
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
I_want_money=IQ_Option("email","password")
goal="EURUSD"
print("get candles")
print(I_want_money.get_candles(goal,60,111,time.time()))
Aleandro21 commented 6 years ago

@Lu-Yi-Hsun same error continue loop: 2018-05-04 13:20:31,101 https://auth.iqoption.com/api/v1.0/login 2018-05-04 13:20:31,102 Starting new HTTPS connection (1): auth.iqoption.com 2018-05-04 13:20:31,238 https://auth.iqoption.com:443 "POST /api/v1.0/login HTTP/1.1" 200 52 2018-05-04 13:20:31,240 <Response [200]> 2018-05-04 13:20:31,241 {"data":{"ssid":"2a5ab145615ccffecfc2108a1d9bb6b8"}} 2018-05-04 13:20:31,241 {'Content-Length': '52', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'X-Content-Type-Options': 'nosniff', 'Set-Cookie': 'ssid=2a5ab145615ccffecfc2108a1d9bb6b8; Path=/; Domain=iqoption.com; Max-Age=2592000', 'Strict-Transport-Security': 'max-age=15555600', 'Server': 'nginx', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Date': 'Fri, 04 May 2018 11:20:31 GMT', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Content-Type': 'application/json; charset=utf-8'} 2018-05-04 13:20:31,241 <<class 'requests.cookies.RequestsCookieJar'>[<Cookie ssid=2a5ab145615ccffecfc2108a1d9bb6b8 for .iqoption.com/>]> 2018-05-04 13:20:31,242 https://iqoption.com/api/getprofile 2018-05-04 13:20:31,243 Starting new HTTPS connection (1): iqoption.com 2018-05-04 13:20:31,400 https://iqoption.com:443 "GET /api/getprofile HTTP/1.1" 200 None 2018-05-04 13:20:31,402 <Response [200]> 2018-05-04 13:20:31,402 {"isSuccessful":true,"message":"","result":{"avatar":"","confirmation_required":0,"popup":{"1":{"name":"mobile_firstdeposit first variant Popup","bonus_code":"WelcomeSplashCode2","countdown":40}},"money":{"deposit":{"min":2,"max":1000000},"withdraw":{"min":2,"max":1000000}},"user_group":"Default","welcome_splash":0,"functions":{"is_bonus_block":0,"is_trading_bonus_block":0,"is_vip_mode":0,"is_no_currency_change":0,"popup_ids":["1"],"ext_fields":[]},"finance_state":"","balance":17364.95,"bonus_wager":0,"bonus_total_wager":0,"balance_id":11997994,"balance_type":4,"messages":0,"id":1243758,"demo":0,"public":1,"group_id":1,"name":"","nickname":null,"currency":"USD","currency_char":"$","mask":"$%s","city":"","user_id":1243758,"first_name":"","last_name":"","phone":"","email":"","created":1422026892,"last_visit":1422879185,"site_id":1,"tz":"Europe\/Berlin","locale":"it_IT","birthdate":677376000,"country_id":97,"currency_id":1,"gender":"male","address":"","postal_index":"","timediff":-3600,"tz_offset":120,"balances":[{"id":1415926,"type":1,"amount":680000,"new_amount":680000,"bonus_amount":0,"bonus_total_amount":0,"currency":"EUR","description":null},{"id":16941471,"type":2,"amount":420000,"new_amount":0,"bonus_amount":0,"bonus_total_amount":0,"currency":"USD","description":null},{"id":11997994,"type":4,"amount":17364950000,"new_amount":0,"bonus_amount":0,"bonus_total_amount":0,"currency":"USD","description":null}],"infeed":1,"confirmed_phones":[""],"need_phone_confirmation":false,"rate_in_one_click":true,"deposit_in_one_click":false,"kyc_confirmed":true,"kyc":{"status":3,"isRegulatedUser":true,"isProfileNeeded":true,"isPhoneNeeded":true,"isDocumentsNeeded":true,"isDocumentsDeclined":false,"isProfileFilled":true,"isPhoneFilled":true,"isDocumentsUploaded":true,"isPhoneConfirmationSkipped":false,"isPhoneConfirmed":true,"isDocumentsUploadSkipped":false,"isDocumentsApproved":true,"isDocumentPoiUploaded":true,"isDocumentPoaUploaded":true,"daysLeftToVerify":-1},"trade_restricted":false,"auth_two_factor":null,"deposit_count":13,"is_activated":true,"new_email":"","tc":true,"trial":false,"is_islamic":false,"tin":"","socials":{"4":{"id":"1560793447317643","token":"EAAUMEkYTM0IBAG0TCTbANNS1lPZBYoo6SiEiQn5rnMBsiH8tkNMmRmKsB5nGI9TEmbHFCa0ImA6o2hZAPZC8zWawbRE5lLjw5Hp5xyScYnDPgi6sqIO68onBYlqRT9ZCZBsvb4YaCYgkim14ccezuT5JgVujlluytY1neKLxZBlw58jhAx0htijFzPxFOyYy3kZCquWh3G2owZDZD","group_member_reward":false}},"flag":"IT","cashback_level_info":{"enabled":false},"user_circle":"No exp","skey":"436c6f42d1c467b7279bad91ec805e69"}} 2018-05-04 13:20:31,403 {'X-Tracing-Key': '0f3af408-92d8-4004-8314-5db5b25a3c16', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'Set-Cookie': 'uat=c9c64e071d2853bc7906c017a231ad1cc46ab630; path=/', 'Strict-Transport-Security': 'max-age=15555600', 'Vary': 'Accept-Encoding', 'Server': 'nginx', 'Connection': 'keep-alive', 'X-Front-Host': 'fe-api-04', 'Access-Control-Allow-Credentials': 'true', 'Date': 'Fri, 04 May 2018 11:20:31 GMT', 'Access-Control-Allow-Origin': 'https://iqoption.com', 'Access-Control-Allow-Headers': 'Content-Type', 'Content-Type': 'application/json; charset=UTF-8'} 2018-05-04 13:20:31,403 <<class 'requests.cookies.RequestsCookieJar'>[<Cookie uat=c9c64e071d2853bc7906c017a231ad1cc46ab630 for iqoption.com/>]> 2018-05-04 13:20:31,403 error connect()

Lu-Yi-Hsun commented 6 years ago

@Aleandro21 I think you update python3 version but you run in python2

Try this for PYTHON 2

sudo pip2 install -U git+git://github.com/Lu-Yi-Hsun/iqoptionapi.git
Aleandro21 commented 6 years ago

@Lu-Yi-Hsun thanks , now work!!

RickyGlobal9 commented 5 years ago

It seems the login url changed to: https://auth.iqoption.com/api/v1.0 then we can get ssid. What to do next? How to get the balance?

To get account balance you will have to "getprofile" relevant calls can be found here https://iqoptionapi.readthedocs.io/en/latest/iqoptionapi.http.html#module-iqoptionapi.http.getprofile