# vesselfinder/container-tracking-api-wrapper architecture

> Architecture diagram of the GitHub repository vesselfinder/container-tracking-api-wrapper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vesselfinder/container-tracking-api-wrapper
- Repository: https://github.com/vesselfinder/container-tracking-api-wrapper

## Overview

This repository provides PHP and Python wrappers for the Container Tracking API. In either language, a caller supplies an API key and container number; the wrapper validates the number and optional sealine, makes an API request, and can poll when the response is pending until it completes or times out. The examples demonstrate ordinary, sealine-specific, and timeout calls. The sampled implementation shows validation, request construction, and polling; the external API’s internal behavior is outside this repository.

Main entry points: [`php/ContainerTrackingApi.php`](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php) (Container method), [`python/containertrackingapi.py`](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py) (Container method)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_php["PHP wrapper"]
  node_php_container["Container method"]
  node_php_validation["Number validation"]
  node_php_http["HTTP request"]
end

subgraph group_python["Python wrapper"]
  node_python_container["Container method"]
  node_python_validation["Number validation"]
  node_python_http["HTTP request"]
end

node_caller(("Client code"))
node_tracking_api{{"Tracking API"}}

node_caller -->|"calls"| node_php_container
node_caller -->|"calls"| node_python_container
node_php_container -->|"validates"| node_php_validation
node_php_container -->|"requests"| node_php_http
node_php_http -->|"sends request"| node_tracking_api
node_tracking_api -->|"returns response"| node_php_http
node_python_container -->|"validates"| node_python_validation
node_python_container -->|"requests"| node_python_http
node_python_http -->|"sends request"| node_tracking_api
node_tracking_api -->|"returns response"| node_python_http

click node_php_container "https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php"
click node_php_validation "https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php"
click node_php_http "https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php"
click node_python_container "https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py"
click node_python_validation "https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py"
click node_python_http "https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_php_container,node_php_validation,node_php_http,node_caller toneBlue
class node_python_container,node_python_validation,node_python_http toneAmber
class node_tracking_api toneMint
```

## Components

### PHP wrapper

- [Container method](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php): `php/ContainerTrackingApi.php`
- [Number validation](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php): `php/ContainerTrackingApi.php`
- [HTTP request](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/php/ContainerTrackingApi.php): `php/ContainerTrackingApi.php`

### Python wrapper

- [Container method](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py): `python/containertrackingapi.py`
- [Number validation](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py): `python/containertrackingapi.py`
- [HTTP request](https://github.com/vesselfinder/container-tracking-api-wrapper/blob/master/python/containertrackingapi.py): `python/containertrackingapi.py`

### Other components

- **Client code**
- **Tracking API**

## Connections

- Client code → Container method: calls
- Client code → Container method: calls
- Container method → Number validation: validates (evidence: `php/ContainerTrackingApi.php`)
- Container method → HTTP request: requests (evidence: `php/ContainerTrackingApi.php`)
- HTTP request → Tracking API: sends request (evidence: `php/ContainerTrackingApi.php`)
- Tracking API → HTTP request: returns response (evidence: `php/ContainerTrackingApi.php`)
- Container method → Number validation: validates (evidence: `python/containertrackingapi.py`)
- Container method → HTTP request: requests (evidence: `python/containertrackingapi.py`)
- HTTP request → Tracking API: sends request (evidence: `python/containertrackingapi.py`)
- Tracking API → HTTP request: returns response (evidence: `python/containertrackingapi.py`)
