ANPA
text/vnd.iptc.anpa
Magic Bytes
Offset: 0
16 16 01
ANPA is a legacy text-based wire service format originally developed by the American Newspaper Publishers Association to facilitate digital communication within the news industry. Historically, news agencies and editorial systems utilized this format to transmit articles, bulletins, and metadata between wire services and newspaper publishing platforms. Although largely superseded by modern XML-based standards like NewsML, this plain-text format poses minimal security risks and remains prevalent in archived journalistic databases.
Validation Code
How to validate .anpa files in Python
Python
def is_anpa(file_path: str) -> bool:
"""Check if file is a valid ANPA by magic bytes."""
signature = bytes([0x16, 0x16, 0x01])
with open(file_path, "rb") as f:
return f.read(3) == signature
How to validate .anpa files in Node.js
Node.js
function isANPA(buffer: Buffer): boolean {
const signature = Buffer.from([0x16, 0x16, 0x01]);
return buffer.subarray(0, 3).equals(signature);
}
Go
func IsANPA(data []byte) bool {
signature := []byte{0x16, 0x16, 0x01}
if len(data) < 3 {
return false
}
return bytes.Equal(data[:3], signature)
}
API Endpoint
GET
/api/v1/anpa
curl https://filesignature.org/api/v1/anpa