借出俱乐部对开二级市场房源API调用不起作用

2024-04-24 10:50:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用这个Python代码访问二级市场上市的folioapi。类似的代码也适用于我的初级贷款俱乐部。这将返回一个错误代码[500],即内部错误。你知道吗

import requests
lc_InvestorId = "1111"
lc_apikey = "xxxx"
lc_module = 'secondarymarket/listings'
url = f"https://api.lendingclub.com/api/investor/v1/{lc_module}"

payload = {}

params = {'updatedSince':10000}

headers = {
    'ContentType': "application/json",
    'Accept': "application/json",
    'Authorization': lc_apikey,
    'X-LC-Application-Key': lc_InvestorId
    }

response = requests.request("GET", url, data=payload, headers=headers, params=params)

Tags: 代码apijsonurlapplication市场paramsrequests
1条回答
网友
1楼 · 发布于 2024-04-24 10:50:55

根据对开票据交易API手册(1/22/2018):

Supported formats: CSV

For the Listings GET call, you must include the Accept: text/csv header and exclude the Content-Type header

将标题更改为以下内容:

headers = {
    'Accept': "text/csv",
    'Authorization': lc_apikey,
    'X-LC-Application-Key': lc_InvestorId
    }

相关问题 更多 >