Hi @Susanbiu627 , I’d like to help you out. 
You can start by listing the line items under each campaign.
Then you can list out targeting criterions under each line item.
Once you have a list of targeting criterions for that campaign, you can filter out the ones with targeting_type as LOCATION.
Once you have a list of LOCATION targeting criterions, filter out once with location_type as COUNTRIES and associate that list with your campaign and return it as response.
I hope this helps.
For reference: https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/targeting-options