-2

I've got XML API data from which I need to take a value and run another API call from it.

<?xml version="1.0" encoding="ISO-8859-1"?>    
<result status="OK" host="systemmonitor.co.uk" created="2018-10-26T09:45:27+01:00">    
<client>    
<clientid>12345</clientid>    
</client>
<client>    
<clientid>67890</clientid>    
</client>

There's about 100 clients in this file and what I need is to be able to take the ClientID value for each one and run it through another API call (I'm assuming I can set it as a variable?)

How would I go about taking the multiple client IDs and running them through API calls to get more data?

1 Answer 1

0

You could use ElementTree to extract the data and then feed that into a list to make your second API call. This post might help: Extracting text from XML using python

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.