# How to fetch API Response In Variable

**URL:** <https://forum.robotframework.org/t/how-to-fetch-api-response-in-variable/5139>\
**Category:** Robot Framework\
**Created:** [5 January 2023 05:59 UTC](https://forum.robotframework.org/t/how-to-fetch-api-response-in-variable/5139 "2023-01-05T05:59:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul12](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rahul12](https://forum.robotframework.org/u/rahul12)\
**Post date:** [5 January 2023 05:59 UTC](https://forum.robotframework.org/t/how-to-fetch-api-response-in-variable/5139/1 "2023-01-05T05:59:50Z")

</div>

Hi I am new at Robot framework  
thanks in advanced  
I want fetch API Response from UI and check the payment button should be visible .  
(In if block I have right condition for if payment button should be visible and else block right condition if payment button is not visible )  
${headers}= Create Dictionary Apikey=${apikey} Username=${userid}  
Create Session session https://${environment}-api.${extension}  
${response}= RequestsLibrary.GET On Session session ${url} headers=${headers}  
${Id}= Get Value From Json ${response.json()} Payment  
${investment} Convert To String ${response.content}  
Log To Console ${Id}  
IF ${investment} == ${Payment}  
Wait Until Element Is Visible ${loc\_Validation}  
ELSE  
Wait Until Element Is Not Visible ${loc\_Validation}  
END

#(in response i get {“investment”:“payment”},“summary”:{“status\_code”:“200”,“status\_message”:“Success”}})  
I want to fetch payment from from response  
in console I get no keyword with name get value from json  
so please help me
