web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / gov.uk Trade Tarriff A...
Power Automate
Unanswered

gov.uk Trade Tarriff API - help?

(1) ShareShare
ReportReport
Posted on by 18

Hi all, hoping for some help here if anyone has used this API before?

 

I have a list of commodity codes and country of origin and I need to get the duty rate for each commodity. 

 

Its straightforward enough for one commodity, I can parse the JSON response and extract the required data, but when I run it on all commodity codes, the JSON response structure is different each time so its failing the flow. 

 

Not an expert at APIs and JSON so tearing my hair out 😞

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @mrdave 

     

    could you share how json output looks like when trying for each commodity code - ?

     

    Also instead of parse json action - try just json() expression where passing the json string as input parameter can help to extract required values from json itself ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • mrdave Profile Picture
    18 on at

    Hi Nived - 

    The documentation is here - 

    https://api.trade-tariff.service.gov.uk/reference.html#get-commodities-id

     

    https://www.trade-tariff.service.gov.uk/api/v2/commodities/3209100000

     

    https://www.trade-tariff.service.gov.uk/api/v2/commodities/3924900000

     

    https://www.trade-tariff.service.gov.uk/api/v2/commodities/4417000000

    Theres no authentication required so you should be able to see the json response from that link

    I need the "verbose_duty" from "duty_expression" but it seems to be in a different footnote each time so I'm struggling to reference it correctly?

     

     

  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @mrdave 

     

    see whether this approach helps ?

     

    Here i used http request to call the api like below

    Nived_Nambiar_0-1720889294390.png

     

    Next i used filter array to filter the type of value duty_expression 

    Nived_Nambiar_1-1720889342080.png

     

    Nived_Nambiar_2-1720889358672.png

     

    Now use select action to take the verbose_duty property value which is coming under attributes property like below

    Nived_Nambiar_3-1720889421180.png

     

     

    This seemed to be working for api s except for 

    https://www.trade-tariff.service.gov.uk/api/v2/commodities/3924900000

     

    https://www.trade-tariff.service.gov.uk/api/v2/commodities/4417000000

     

    as this is showing some error on http request itself. But for success scenario- it works 🙂

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

     

  • mrdave Profile Picture
    18 on at

    Thank you for your help!

     

    With a couple of tweaks I think I'm close now. I have managed to extract the "third_country_duty" by first filtering the array for the "import_trade_summary"

     

    I believe this is pretty close to where I need to be - but the perfect solution would be to also look at the country of origin (which I also have in my data, which would give me a "measure_type" and then the accurate  duty amount would be.

     

    For example, If I was importing (https://www.trade-tariff.service.gov.uk/api/v2/commodities/3209100000) from Albania (AL)  I would need to find the measure containing AL, and then take the "verbose_duty" from its parent, somehow.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard