py5paisa
py5paisa copied to clipboard
MarketFeed "Invalid head parameters"
- 5paisa Python SDK version:
- Python version:
- Operating System:
Description
I GOT THE FOLLOWING ERROR MESSAGE. I ALREADY CHECK ALL CREDENTIALS.
{'body': None, 'head': {'responseCode': '5PMF', 'status': '2', 'statusDescription': 'Invalid head parameters.'}}
please see the script is as follow
import requests import json
def streamData(): url = 'https://openapi.5paisa.com/VendorsAPI/Service1.svc/MarketFeed' headers = { "appName": "5P53761740", "appVer": "1.0", "key": "xxxxxxxxxxxxx", "osName": "web", "requestCode": "5PMF", "userId": "xxxxxxx", "password": "xxxxxxxxx" } data = { "Count": 53761740,"MarketFeedData":[{"Exch":"N","ExchType":"C","Symbol":"SBIN","Expiry":"","StrikePrice":"430","OptionType":""}],"ClientLoginType":0,"LastRequestTime":"/Date(0)/","RefreshRate":"H" } r = requests.post(url=url, headers=headers, data=json.dumps(data)) return r
r = streamData() print(r.json())
############ REFF. Document https://www.5paisa.com/developerapi/current-market-data
please help me to solve this issue. is there any sample script available? [ not looking FOR SDK ]