I have noticed that the result is a string and managed to extract information using regex. However, if you also have solutions for the languages I am using I would be happy to know. Thanks in advanced!!
p.s. the screenshot is when I accessed your api using Python.
The value of the result part is a string which I convert from a json object. If you copy the string and check, you will find it is a valid json string.
Here’s a piece of PHP code I wrote which might help you understand how to interpret the result(replace x-rapid-key with your own one):
I don’t see your attachment. Anyway, here are the source code for python & js. Hope that helps.
Python:
https://drive.google.com/file/d/1P850m2IsemJw-YnTWxUA59Y86MQY965K/view?usp=sharing
Js:
https://drive.google.com/file/d/1CenagktVjnX69cJmdiVGxTc1-Hrduc2K/view?usp=sharing
Thanks!
I use JavaScript and Python to access your api.
I have noticed that the result is a string and managed to extract information using regex. However, if you also have solutions for the languages I am using I would be happy to know. Thanks in advanced!!
p.s. the screenshot is when I accessed your api using Python.
Don’t know why my code turns into something unreadable, I uploaded it to GDrive in a txt file: https://drive.google.com/file/d/1c2XQVWKRe9ohQ5uuoqMmJ7iTD9RGD3VA/view?usp=sharing
Hi,
The value of the result part is a string which I convert from a json object. If you copy the string and check, you will find it is a valid json string.
Here’s a piece of PHP code I wrote which might help you understand how to interpret the result(replace x-rapid-key with your own one):
url=′https://chinese−lunar−calendar.p.rapidapi.com/?date=20230124′;ch = curl_init($url);
headers=[′X−RapidAPI−Key:00000000000000′,′X−RapidAPI−Host:chinese−lunar−calendar.p.rapidapi.com′];curlsetopt(ch, CURLOPT_HTTPHEADER, headers);curlsetopt(ch, CURLOPT_POST, 0);
curl_setopt(ch,CURLOPTRETURNTRANSFER,true);response = curl_exec(ch);curlclose(ch);
responseinjson=jsondecode(response);
result=jsondecode(responseinjson->result);
var_dump($result->lunarDateinChinese);
Please let me know if that answers your question. If you use other programming languages, please tell me so I can check as well. Cheers