Download the PHP package jpzip/jpzip without Composer

On this page you can find all versions of the php package jpzip/jpzip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jpzip

Latest Version on Packagist PHP Version Require Docs Test

PHP SDK for jpzip — a free, unlimited Japanese postal code (郵便番号) API. 日本の全郵便番号 120,677 件を CDN 配信 JSON から引く PHP SDK。

English | 日本語

jpzip/jpzip looks up Japanese postal codes (郵便番号) from jpzip.nadai.dev, a CDN-hosted dataset built from Japan Post's KEN_ALL.csv and KEN_ALL_ROME.csv normalized to JSON. No registration, no rate limits, no API key.

Requirements

Install

Quick Start

Romaji and government codes are on the same entry:

Use Cases

Zipcode lookup HTTP endpoint (Laravel)

Zipcode lookup HTTP endpoint (Slim 4)

Batch validation

Serve lookups from cache (BYO L2 backend)

The dataset is partitioned into 948 three-digit prefix buckets. The default L1 (100 entries) keeps the hottest buckets; to cache the whole dataset, pair preload('all') with an L2 cache or raise memoryCacheSize above 948.

API Reference

Functions (namespace Jpzip, share a default Client)

Function Description
Jpzip\lookup(string $zipcode): ?ZipcodeEntry Look up a single 7-digit zipcode. Returns null if not found or malformed (no network call for malformed input).
Jpzip\lookupGroup(string $prefix): array<string, ZipcodeEntry> Look up by 1-, 2-, or 3-digit prefix. 1-digit fetches /g/{d}.json; 3-digit fetches /p/{ddd}.json; 2-digit fans out into 10 parallel 3-digit fetches and merges.
Jpzip\lookupAll(): array<string, ZipcodeEntry> Fetch entire dataset (120k entries, ~37 MiB) in parallel across /g/0..9.json.
Jpzip\getMeta(): ?Meta Dataset version, generated-at, per-prefecture counts, spec version. Result is cached until refresh().
Jpzip\preload(string $scope): void Warm L1 (and L2 when configured) for "all" or a specific 1–3-digit prefix.
Jpzip\isValidZipcode(string $s): bool Pure syntax check (^\d{7}$) — no network.

Jpzip\Client (advanced)

A configurable instance; required for L2 caching, custom HTTP client, alternate base URL, or multiple isolated caches:

Client exposes lookup() / lookupGroup() / lookupAll() / getMeta() / preload() plus:

Method Description
$client->refresh() Wipe L1 (and L2 when configured) and forget the cached meta.

When getMeta() observes that /meta.json's version has changed since the last successful fetch, L1 and L2 are cleared automatically — call getMeta() periodically to pick up dataset rollovers.

DTOs

All DTOs are final readonly classes with typed properties:

Each DTO exposes toArray() for JSON serialization and ::fromArray() for deserialization.

Errors

CacheInterface

Bring your own L2 backend (file, APCu, Redis, Memcached, KV, etc.):

Keys are the full prefix-bucket URLs (e.g. https://jpzip.nadai.dev/p/231.json); values are raw JSON bytes.

Adapters for PSR-16 (Psr\SimpleCache\CacheInterface) and PSR-6 (Psr\Cache\CacheItemPoolInterface) can be written as ~20-line wrappers around the contract above.

Why jpzip/jpzip?

jpzip/jpzip sukohi/laravel-jp-postal-code edgecreativemedia/japanaddressing zipcloud API
Romaji (Yokohama Shi) ✅ ❌ ✅ ❌
Government codes (JIS / 総務省) ✅ ❌ ❌ ❌
No manual CSV download / DB seed ✅ ❌ Manual KEN_ALL.CSV ✅ Bundled ✅
Framework-agnostic ✅ ❌ Laravel-only ✅ ✅
Monthly updates ✅ Auto ❌ Manual ❌ Abandoned (2016) ✅
Offline after preload ✅ ✅ ✅ ❌
Rate-limit-free ✅ ✅ ✅ ⚠️ Discouraged for bulk
L1 + pluggable L2 cache ✅ ❌ ❌ ❌
Modern PHP (8.2+, readonly DTOs) ✅ ❌ ❌ PHP 5.4 n/a

Other Languages

Same API surface across all SDKs:

Go · TypeScript · Python · Rust · Ruby · Swift · Dart

Resources

Keywords

japanese postal code, japan zipcode, 郵便番号, KEN_ALL, KEN_ALL_ROME, address validation, address autocomplete, japan address api, postal code lookup php, php japanese address, laravel zipcode, slim zipcode, JIS X 0401, 総務省地方公共団体コード

License

MIT


All versions of jpzip with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jpzip/jpzip contains the following files

Loading the files please wait ...