NOLookup::BrregDifi::DataLookup - Lookup Brreg basic organization data from the JSON formatted service offered by the Difi Brreg data API via "";

(Brreg is a short name for 'Brønnøysundregistrene, the Norwegian Central Organization Registry).


Use WWW::Mechanize and JSON to lookup data from the JSON API at brreg. Use NOLookup::BrregDifi::Entry module to map the resulting json data structure to a NOLookup::BrregDifi::Entry objects.

The timeout period $BRREG_TIMEOUT is used to trap and return the call if Brreg lookup is hanging for some reason.


The module provides the below methods.


Lookup based on a complete organization number.

Returns an array of one single NOLookup::Brreg::Entry object in the data when a match is found.


Lookup based on a complete or part of an organization name.

Mandatory parameters are: $orgname: the orgname (or part of) to search for

Optional parameters are: $max_no_pages: max. number of pages to return, default 10. $page_ix : index to the first page to fetch, default 1.

Returns 0 entries if none found.

Returns an array of NOLookup::Brreg::Entry objects in the data when matches are found.

Note: A maximum of 5 pages are fetched, each of 100 entries.


Check if org. number basic syntax is OK, i.e. 9 digits. Note that Brreg may reject the number due to stricter requirements, like checksum etc.


The raw JSON data structure, as returned by the JSON service, and then decoded to a perl data structure with decode_json().


Set if an error has occured. On errors, the lookup terminates, with more info in the status().


Set if a warning has occured. On warnings, the lookup continues, but warnings are accumulated in the status().


Further description of error/warning situations.


Found data, an array of NOLookup::BrregDifi::Entry data objects.

See doc. for NOLookup::BrregDifi::Entry for details.


The number of objects in data().


The total number of objects in data[].

Only set if all data has been fetched.

Only if total_size is set, the user can assume that all data has been fetched.


The total number of pages that the query produces. Only if all pages are fetched, you have it all.


The current page number.


The next page number, if more exists.


The previous page number, unless you are on the first page.


For now, support questions should be sent to:


Please also see the SUPPORT file in the distribution.



Trond Haugen, <(nospam)info(at)>


Copyright (c) 2017 Trond Haugen <(nospam)info(at)>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.