API Reference

Endpoint Listing and Descriptions

Endpoint Description Argument
/pig/ Get the list of PIG folders available for querying along with the halo numbers and redshifts
/pig/{id} Get snapshot info in PIG_{id}
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
/pig/{id}/{ptype} Get the list of {ptype} particle features available for querying in PIG_{id}
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { ptype }: Name of particle type. It should be a string and in ['gas', 'dm', 'star', 'bh'].
​/pig​/{id}​/fofgroup Get the list of FoFgroup features available for querying in PIG_{id}
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
/pig​/{id}/lengthbytype​/n={num} Get the length info of the first {num} halos in PIG_{id}
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { num }: Number of halos. It should be an integer and be between 1 to the max halo size.
/pig​/{id}/lengthbytype/{halo_id}/{type_id} Get the number of {type_id} particles in the {halo_id}th halo in PIG_{id}
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { halo_id }: ID of a halo. It should be an integer and be between 0 to the max halo ID.
  • { type_id }: ID of particle type. It should be an integer and between [0,6).
/pig/{id}/{ptype}/{feature}/{group_id} Get the {feature} data of {ptype} particle in {group_id} group and PIG_{id} folder
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { feature }: Feature of a particle type. It should be a string. Eg. "Density", "ElectronAbundance", "H2Fraction", etc.
  • { group_id }: ID of a halo group. It should be an integer and be between 1 to the max halo group size.
/pig/{id}/lengthbytype/?{group_query} Execute {group_query} and get the length info of the a list of halos in PIG_{id}
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { group_query }: A list of group IDs. It should be a list and pass as a query parameter.
POST/pig/{id}/{ptype}/{feature}/, data = {ID_list} Get all {feature} data of {ptype} particle in the group {ID_list} and PIG_{id} folder
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { ptype }: Name of particle type. It should be a string and in ['gas', 'dm', 'star', 'bh'].
  • { feature }: Feature of a particle type. It should be a string. Eg. "Density", "ElectronAbundance", "H2Fraction", etc.
  • { ID_list }: A list of group IDs. It should be a list and pass as request body with post method.
/pig​/{id}​/search​/{ptype}​/{feature}​/{criterion}/?{range_query} Get a dictionary of {groupid:data} for data of {feature} {ptype} particle within the searching {criterion}.
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { ptype }: Name of particle type. It should be a string and in ['gas', 'dm', 'star', 'bh'].
  • { feature }: Feature of a particle type. It should be a string. Eg. "Density", "ElectronAbundance", "H2Fraction", etc.
  • { criterion }: Searching criterion. It should be a string and in ['bh_mass', 'gas_mass', 'dm_mass', 'star_mass', 'bh_mdot'].
  • { range_query }: The min_range and max_range of a certain criterion. Both min_range and max_range are float, and pass as an optional query parameter.
/pig/{id}/fofgroup/{fof_feature}/{group_id} Get the {feature} data of FOFGroup in {group_id} group and PIG_{id} folder
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { group_id }: ID of a halo group. It should be an integer and be between 1 to the max halo group size.
  • { fof_feature }: Feature of a FOFGroup. It should be a string. Eg. "LengthByType", "OffsetByType", "MassByType", etc.
/pig/{id}/search_id/{ptype}/{fof_feature}?{range_query} Get all halo IDs of {ptype} particles for {feature} matching some searching {range_query} criterion in a PIG_{id} folder
  • { id }: ID of a pig folder. It should be an integer and in [184, 197, 208, 216, 222, 230, 237, 244, 251, 258, 265, 271].
  • { ptype }: Name of particle type. It should be a string and in ['gas', 'dm', 'star', 'bh'].
  • { range_query }: The min_range and max_range of a certain criterion. Both min_range and max_range are float, and pass as an optional query parameter.
  • { fof_feature }: Feature of a FOFGroup. It should be a string. Eg. "LengthByType", "OffsetByType", "MassByType", etc.

Data Access:

The web-based API interface can respond to a variety of user requests and queries. To access the it, please click "http://bluetides-api.psc.edu/docs".

Search Requests:

Several API functions accept additional, optional query parameters, descriptions are as belows:

{group_query} is a list of group IDs. For example:

{range_query} is the min_range and max_range of a certain criterion. For example:

Some API functions accept post method to pass necessary data in request body, descriptions are as belows:

{ID_list} is a list of group IDs. For example:

Response Codes:

The Cosmo API will return a subset of standard HTTP response codes, in particular:

Rest API Glossary:

Full-path examples

The followings are absolute URLs for the cosmo API.