Skip to content

spec api

David E. Wheeler edited this page Apr 28, 2011 · 5 revisions

Meta Spec API

  • Name: spec
  • Returns: text/plain; charset=utf-8
  • URI Template Variables: {format}
  • Availability: Mirror Server, API Server

Returns the contents of the version of the PGXN Meta Spec used by the network. This document describes the data that must and can be included in the META.json files in releases uploaded to the network. The canonical copy may be found here; an HTML rendition is published here.

The single URI template variable is {spec}. It may have one of two values:

  • txt: Returns the spec formatted as plain text.
  • html: Returns the spec formatted as HTML. Available from API servers only.

Perl Example

Assuming you have retrieved the JSON document from the index API and stored the data in the $table hash, you can fetch the contents of the PGXN Meta Spec like so:

use URI::Template;
use HTTP::Tiny;
my $tmpl = URI::Template->new($table->{spec});
my $uri = $tmpl->process({ format => 'txt' });

my $req  = HTTP::Tiny->new;
my $res  = $req->get('http://master.pgxn.org' . $uri);
say $res->{content};
Something went wrong with that request. Please try again.