in reply to Re: Parsing the data returned from the companies house API
in thread Parsing the data returned from the companies house API
Now this is returning the directors and their addresses, so I should be able to move forward handling each element.use warnings; use strict; use JSON; #use vsutils; use Data::Dumper; use Ref::Util qw(is_arrayref is_hashref); my $companyNumber = 'NF001553'; my $request = "https://api.company-information.service.gov.uk/com +pany/".$companyNumber."/officers"; my $curl = `curl -s --user sameAPIKeyAsBefore:"" $request` || die + "SOMETHING IS WRONG HERE\n"; my $decodedJSON = decode_json($curl) || die "this is not JSON\n"; if (is_hashref($decodedJSON)){ for (sort keys %$decodedJSON) { if ($_ eq 'items'){ print Dumper($decodedJSON->{$_}); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing the data returned from the companies house API
by choroba (Cardinal) on Oct 17, 2022 at 15:00 UTC | |
by irtuk (Novice) on Oct 17, 2022 at 15:55 UTC | |
by choroba (Cardinal) on Oct 17, 2022 at 17:15 UTC |