Power BI Integration
Connect to this API from Power BI Desktop:
1. Get Data → Web
Enter the API URL (returns all records by default):
https://mou.mrl.dev/api/inspections
2. Authentication
When prompted, select Basic and enter your credentials:
- Username: [your username]
- Password: [your password]
Note: By default, all records are returned. Use ?limit=10000
to paginate if needed.
3. Query Parameters (Optional)
- limit - Records per page (default: all records)
- offset - Starting position (use with limit for pagination)
- source - Filter by MoU (detentions only)
- detention_only - Only inspections with detentions (inspections only)
4. Alternative: M Query with Credentials
If you prefer to embed credentials in the query (avoids auth prompts):
- Power BI Desktop → Get Data → Blank Query
- Advanced Editor → Paste this code
let
Source = Json.Document(
Web.Contents("https://mou.mrl.dev/api/inspections")
),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null,
ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1",
{"imo", "ship_name", "inspection_id", "date_of_inspection", "place_of_inspection", "flag",
"deficiency_code", "inspected_by", "is_detention", "rectified", "detention",
"nature_of_deficiency", "date_of_release"},
{"imo", "ship_name", "inspection_id", "date_of_inspection", "place_of_inspection", "flag",
"deficiency_code", "inspected_by", "is_detention", "rectified", "detention",
"nature_of_deficiency", "date_of_release"})
in
#"Expanded Column1"
5. Available Fields
- imo - Ship IMO number
- ship_name - Vessel name
- inspection_id - Unique identifier for each inspection (MD5 hash of IMO + date +
place)
- date_of_inspection - Inspection date (DD/MM/YYYY format)
- place_of_inspection - Port/location where inspection occurred
- flag - Ship's flag state
- deficiency_code - Specific deficiency code found during inspection
- nature_of_deficiency - Description of the deficiency type
- inspected_by - Maritime authority (Indian Ocean MoU, Paris MoU, Tokyo MoU, USCG)
- is_detention - Boolean flag: 1 if inspection resulted in vessel detention, 0
otherwise
- detention - Per-deficiency "Ground for detention" flag: "yes" if this specific
deficiency was grounds for detention, "no" otherwise
- rectified - Whether deficiency was fixed: "Yes" or "No" (mostly available for
Indian Ocean MoU)
- date_of_release - Date vessel was released from detention (DD/MM/YYYY), blank if
not detained or release date unavailable
Important Notes:
- Multiple deficiencies from the same inspection share the same inspection_id,
allowing you to group deficiencies by inspection event
- is_detention indicates if the entire inspection resulted in a detention
(cross-referenced with detentions.db)
- detention indicates if this specific deficiency was marked as "Ground for
detention" by the authority
- Not all deficiencies with detention="yes" result in actual vessel detention (is_detention=1)