openapi: "3.1.0" info: description: This is the NASA TOLNet self-documenting JSON REST API. Engage the API interactively here or directly on the API endpoints. version: "1.0" title: TOLNet API termsOfService": "https://www.nasa.gov/about/highlights/HP_Privacy.html" schemes: - https servers: # used for relative URLs in components: securitySchemes: - url: /api/ description: Most recent version of the API components: securitySchemes: ursOAuth2: type: oauth2 description: Earthdata Login SSO (Single-SignOn) Authentication (Login) flows: implicit: # allowed values: authorizationCode | implicit | password | clientCredentials authorizationUrl: /api/auth/authorize scopes: {} securitySchemes: cookieAuth: # arbitrary name for the security scheme; will be used in the "security" key later type: apiKey in: cookie name: PHPSESSID # cookie name tags: - name: Data description: TOLNet data and details - name: Instruments description: Instrument names and details - name: Documents description: TOLNet Documents - name: Metrics description: Get upload and download metris # - name: UploadDocument # description: Upload a Document # - name: UploadData # description: Upload Data paths: /data/{page}: get: summary: Get information about all TOLNet data description: Basic information about TOLNet data operationId: getData parameters: - name: page in: path description: This API returns data file info 40 items at a time. Each group of 40 is one page of data. This paramater tells the API which page of restulst to return. Must be 1 or greater. example: 1 default: 1 required: true schema: type: integer - name: instrument_group in: query description: One or more (comma-separated) instrument_group ids example: '1,2,3,4' required: false schema: type: string - name: product_type in: query description: One or more (comma-separated) product_type ids example: '5' required: false schema: type: string - name: processing_type in: query description: One or more (comma-separated) processing_type ids example: '2' required: false schema: type: string - name: file_type in: query description: One or more (comma-separated) file_type ids example: '1' required: false schema: type: string - name: near_real_time in: query description: Filter by files that are near real time or not. If the string 'true' is sent, the query will return only near real time files. If the string 'false' is sent, the query will return only files that are not near real time. If you don't send a near_real_time value, the query will return both near real time files and non-near real time files. example: 'false' required: false schema: type: string - name: min_date in: query description: Exclude all data before this date. Must be in the format of YYYY-MM-DD. For example, 2021-05-01 required: false schema: type: string - name: max_date in: query description: Exclude all data after this date. Must be in the format of YYYY-MM-DD. For example, 2024-05-01 required: false schema: type: string - name: min_upload_date in: query description: Exclude all data uploaded before this date. Must be in the format of YYYY-MM-DD. For example, 2024-05-01 required: false schema: type: string - name: max_upload_date in: query description: Exclude all data uploaded after this date. Must be in the format of YYYY-MM-DD. For example, 2024-05-01 required: false schema: type: string - name: latitude in: query description: Search for data with the given latitude, within the provided radius parameter. If you provide a latitude, it must be a real number between -90 and 90, inclusive. If you provide a latitude, you also need to provide a longitude. #example: 37.1 required: false schema: type: number minimum: -90 maximum: 90 - name: longitude in: query description: Search for data with the given longitude, within the provided radius parameter. If you provide a longitude, it must be a real number between -180 and 180, inclusive. If you provide a longitude, you also need to provide a latitude. #example: -76.39 required: false schema: type: number minimum: -180 maximum: 180 - name: radius in: query description: How many kilometers away from the provided latitude and longitude should the API search? This will only be used if the latitude and/or longitude is provided. The default value is 100 km. If you provide a radius, it must be a real number between 0 and 1000, inclusive. #default: 100 required: false schema: type: number minimum: 0 maximum: 1000 - name: minLatitude in: query description: 'One of the 4 parameters needed to perform a lat/long bounding box search. All 4 are needed: minLatitude, minLongitude, maxLatitude, and maxLongitude. Must be a real number between -90 and 90, inclusive.' required: false schema: type: number minimum: -90 maximum: 90 - name: minLongitude in: query description: 'One of the 4 parameters needed to perform a lat/long bounding box search. All 4 are needed: minLatitude, minLongitude, maxLatitude, and maxLongitude. Must be a real number between -180 and 180, inclusive.' required: false schema: type: number minimum: -180 maximum: 180 - name: maxLatitude in: query description: 'One of the 4 parameters needed to perform a lat/long bounding box search. All 4 are needed: minLatitude, minLongitude, maxLatitude, and maxLongitude. Must be a real number between -90 and 90, inclusive.' required: false schema: type: number minimum: -90 maximum: 90 - name: maxLongitude in: query description: 'One of the 4 parameters needed to perform a lat/long bounding box search. All 4 are needed: minLatitude, minLongitude, maxLatitude, and maxLongitude. Must be a real number between -180 and 180, inclusive.' required: false schema: type: number minimum: -180 maximum: 180 - name: order in: query description: In what order should the data be returned? Valid values are data_date, upload_date, instrument_group_name, product_type_name, processing_type_name, file_type_name, or file_name example: data_date default: data_date required: false schema: type: string - name: order_direction in: query description: Should the order be ascending or descending? Valid values are asc or desc example: desc default: desc required: false schema: type: string responses: 200: description: OK content: application/json: schema: type: "object" items: documents: - id: type: integer - $ref: "#/definitions/Data" 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid page" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds page number" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Data /data/search_by_file_name: get: summary: Get information about a specific file, given a file name description: Basic information about a TOLNet data file operationId: getDataByFileName parameters: - name: file_name in: query description: The name of the file you want to search for example: 'groundbased_lidar.o3_nasa.gsfc003_hires_oldfield.ny_20230814t000000z_20230815t000000z_001.hdf' required: true schema: type: string - name: match_type in: query description: What type of file name match should the search perform? The options are exact_match, begins_with, or ends_with. If you don't provide a value for this field, it will default to exact_match. example: 'exact_match' required: false schema: type: string responses: 200: description: OK content: application/json: schema: type: "object" items: documents: - id: type: integer - $ref: "#/definitions/Data" 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid file name" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds page number" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Data /data/product_types: get: summary: Get information on all data product_types description: Get a list of all product_types and descriptions operationId: getProductTypes consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: product_types: - $ref: "#/definitions/ProductTypes" 404: description: "Not found: no product_types found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Data /data/processing_types: get: summary: Get information on all data processing_types description: Get a list of all processing_types and descriptions operationId: getProcessingTypes consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: processing_types: - $ref: "#/definitions/ProcessingTypes" 404: description: "Not found: no processing_types found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Data /data/file_types: get: summary: Get information on all data file_types description: Get a list of all file_types and descriptions operationId: getFileTypes consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: file_types: - $ref: "#/definitions/FileTypes" 404: description: "Not found: no file_types found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Data /data/download/{ids}: get: summary: Download TOLNet data description: Download TOLNet data if the user should have access to that data.

NOTE: you must be logged in to download data. Use the Authorize button at the top of this page first, to set up an authorized session.

If you want to use the curl command
  1. First you will need to set up a .urs_cookies file by following these directions .
  2. Then intialize your session with
    curl -k -b ~/.urs_cookies -c ~/.urs_cookies -L -n -X GET "https://tolnet.larc.nasa.gov/api/auth/login" -H "accept: application/json"
  3. Then you should be able to run the curl command like
    curl -k -b ~/.urs_cookies -c ~/.urs_cookies -L -n -X GET "https://tolnet.larc.nasa.gov/api/data/download/93" -H "accept: application/json" --output data.zip
    1. operationId: getDataDownload parameters: - name: ids in: path description: A comma-delimited list of data ids, not to exceed 35 ids. No more than 35 files can be downloaded with one API request. example: 341 required: true schema: type: string responses: 200: description: A file content: application/pdf: schema: type: string format: binary 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid data id" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds data" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Data /data/calendar: get: summary: Get a date driven list of all available TOLNet data description: This will return the data in chronological order operationId: getDataCalendar parameters: - name: instrument_group in: query description: One instrument_group id example: '2' required: true schema: type: string - name: file_type in: query description: One file_type id example: '1' required: true schema: type: string - name: product_type in: query description: One product_type id (optional) example: '5' required: false schema: type: string - name: processing_type in: query description: One processing_type id (optional) example: '2' required: false schema: type: string responses: 200: description: OK content: application/json: schema: type: "object" items: documents: - id: type: integer - $ref: "#/definitions/Data" 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid page" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds page number" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Data /data/json/{id}: get: summary: Json versions of the TOLNet data description: Retrive a json version of TOLNet data with select fields only operationId: getDataJson parameters: - name: id in: path description: one data id associated with one hi-res TOLNet file example: 341 required: true schema: type: integer responses: 200: description: A json file content: application/pdf: schema: type: string format: binary 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid data id" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds data" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Data /data/json_for_graph/{id}: get: summary: Json versions of the TOLNet data that includes O3_Number_Density and the start and stop dates description: Retrive a json version of TOLNet data with select fields only operationId: getDataJsonForGraph parameters: - name: id in: path description: one data id associated with one hi-res TOLNet file example: 341 required: true schema: type: integer responses: 200: description: A json file content: application/pdf: schema: type: string format: binary 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid data id" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds data" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Data # /data/upload: # post: # summary: Upload a document # description: The endpoint accepts a file and informaiton about the file. Max file size is 100 MB for an individual file and 1 GB for a zip file. # operationId: uploadData # consumes: # - application/x-www-form-urlencoded: # parameters: # - in: formData # name: file # required: true # description: The file to upload. # schema: # type: file # #type: string # format: binary # - in: formData # name: public # required: true # description: Should this data be avaible to the public? Regular users will not be able to download non-public data. Regular users can still view plots of non-public data. Those plots will have a field data disclaimer. # example: false # default: false # schema: # type: boolean # - in: formData # name: nearRealTime # required: true # description: Is this data near real-time? # example: false # default: false # schema: # type: boolean # - in: formData # name: scanOnly # required: true # description: Should this file just be scanned? This will NOT save the file for others to download. # example: false # default: false # schema: # type: boolean # requestBody: # content: # application/x-www-form-urlencoded: # schema: # type: object # properties: # public: # type: boolean # example: false # nearRealTime: # type: boolean # example: false # scanOnly: # type: boolean # example: false # file: # type: string # format: binary # encoding: # file: # # only accept these types of files # contentType: application/pdf, image/jpeg, video/mpeg, # video/avi, video/mp4, image/tiff, image/jpeg, # text/plain, image/png, image/gif, application/pdf, # application/msword, # application/vnd.openxmlformats-officedocument.wordprocessingml.document, # application/vnd.ms-excel, # application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, # application/vnd.openxmlformats-officedocument.presentationml.presentation # headers: # X-Rate-Limit-Limit: # description: The number of allowed requests in the current period # schema: # type: integer # responses: # 200: # description: OK # content: # application/json: # schema: # $ref: "#/definitions/UploadData" # 503: # description: Service unavailable # schema: # $ref: "#/definitions/Error" # security: # - cookieAuth: [] # tags: # - UploadData /instruments/groups: get: summary: Get information on all instrument groups description: Get a list of all instrument groups and descriptions operationId: getInstruments consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: instruments: - $ref: "#/definitions/InstrumentGroups" 404: description: "Not found: no instruments found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Instruments /document/{id}: get: summary: Get information about a single TOLNet document description: Get information about a single TOLNet document if the user should have access to that document operationId: getDocument parameters: - name: id in: path description: One document id example: 1 required: true schema: type: integer responses: 200: description: OK content: application/json: schema: type: "object" items: documents: - id: type: integer - $ref: "#/definitions/Documents" 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid document" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds document" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Documents /document/download/{id}: get: summary: Download a single TOLNet document description: Download a single TOLNet document if the user should have access to that document operationId: getDocumentDownload parameters: - name: id in: path description: One document id example: 1 required: true schema: type: integer responses: 200: description: A file content: application/pdf: schema: type: string format: binary 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid document" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds document" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Documents /documents/{page}: get: summary: Get document information for all TOLNet documents description: Basic information about TOLNet documents operationId: getDocuments parameters: - name: page in: path description: Starting nth page (n >= 1) example: 1 default: 1 required: true schema: type: integer - name: type in: query description: One or more (comma-separated) type ids example: '1,3' required: false schema: type: string - name: q in: query description: Search phrase (key words) example: ABC required: false schema: type: string - name: order in: query description: In what order should the documents be returned? Valid values are display_date, document_name, author, document_type_name, or public example: display_date default: display_date required: false schema: type: string - name: order_direction in: query description: Should the order be ascending or descending? Valid values are asc or desc example: desc default: desc required: false schema: type: string responses: 200: description: OK content: application/json: schema: type: "object" items: documents: - id: type: integer - $ref: "#/definitions/Documents" 400: # note: swagger API front-end will intercept non-integer bad requests # such as 1.23 or "abc" before they are sent to the backend description: "Bad request: invalid page" schema: $ref: "#/definitions/Error" 404: description: "Not found: out-of-bounds page number" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [] tags: - Documents /metrics/upload: get: summary: Get upload metrics grouped by upload date description: Get a year and month summary of upload metrics by upload date, for Admins only operationId: getUploadMetrics consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: metrics: - $ref: "#/definitions/MetricsResults" 401: description: "Unauthrized" schema: $ref: "#/definitions/Error" 404: description: "Not found: no metrics found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Metrics /metrics/upload_by_data_year: get: summary: Get upload metrics grouped by data year description: Get a yearly summary of upload metrics by data date year, for Admins only operationId: getUploadMetricsByDataDateYear consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: metrics: - $ref: "#/definitions/MetricsYearlyResults" 401: description: "Unauthrized" schema: $ref: "#/definitions/Error" 404: description: "Not found: no metrics found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Metrics /metrics/download: get: summary: Get download metrics description: Get a year and month summary of download metrics, for Admins only operationId: getDownloadMetrics consumes: [ ] produces: - "application/json" responses: 200: description: OK content: application/json: schema: type: object items: metrics: - $ref: "#/definitions/MetricsResults" 401: description: "Unauthrized" schema: $ref: "#/definitions/Error" 404: description: "Not found: no metrics found" schema: $ref: "#/definitions/Error" 503: description: Service unavailable schema: $ref: "#/definitions/Error" security: [ ] tags: - Metrics # /uploadDocument: # post: # summary: Upload a document # description: The endpoint accepts a file and informaiton about the file. # operationId: uploadDocument # consumes: # - application/x-www-form-urlencoded: # parameters: # - in: formData # name: file # required: true # description: The file to upload. # schema: # type: file # - in: formData # name: author # required: true # description: Author associated with this document. # example: "LastName, FirstName" # default: "LastName, FirstName" # schema: # type: string # - in: formData # name: public # required: false # description: Should this document be avaible to the public? # example: false # default: false # schema: # type: boolean # - in: formData # name: document_type_id # required: true # description: ID of the Document Type for this document. # example: 1 # default: 1 # schema: # type: integer # - in: formData # name: display_date # required: true # description: Date associated with this document. # example: "2020-05-15" # default: "2020-05-15" # schema: # type: string # format: date # requestBody: # content: # application/x-www-form-urlencoded: # schema: # type: object # properties: # author: # type: string # example: "LastName, FirstName" # public: # type: boolean # example: false # document_type_id: # type: integer # example: 1 # display_date: # type: string # format: date # example: "2020-05-15" # file: # type: string # format: binary # encoding: # file: # # only accept these types of files # contentType: application/pdf, image/jpeg, video/mpeg, # video/avi, video/mp4, image/tiff, image/jpeg, # text/plain, image/png, image/gif, application/pdf, # application/msword, # application/vnd.openxmlformats-officedocument.wordprocessingml.document, # application/vnd.ms-excel, # application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, # application/vnd.openxmlformats-officedocument.presentationml.presentation # headers: # X-Rate-Limit-Limit: # description: The number of allowed requests in the current period # schema: # type: integer # responses: # 200: # description: OK # content: # application/json: # schema: # $ref: "#/definitions/UploadDocument" # 503: # description: Service unavailable # schema: # $ref: "#/definitions/Error" # security: [] # tags: # - UploadDocument definitions: Error: type: object properties: status: type: integer message: type: string Data: type: object properties: row: type: integer count: type: integer id: type: integer file_name: type: string file_server_location: type: string author: type: string instrument_group_id: type: integer product_type_id: type: integer file_type_id: type: integer start_data_date: type: string end_data_date: type: string upload_date: type: string-time public: type: boolean instrument_group_name: type: string folder_name: type: string current_pi: type: string doi: type: string citation_url: type: string product_type_name: type: string processing_type_name: type: string file_type_name: type: string revision: type: integer near_real_time: type: string file_size: type: integer latitude: type: number longitude: type: number altitude: type: integer isAccessible: type: boolean ProductTypes: type: object properties: id: type: integer product_type_name: type: string description: type: string display_order: type: integer ProcessingTypes: type: object properties: id: type: integer processing_type_name: type: string description: type: string display_order: type: integer FileTypes: type: object properties: id: type: integer file_type_name: type: string description: type: string display_order: type: integer InstrumentGroups: type: object properties: id: type: integer instrument_group_name: type: string folder_name: type: string description: type: string current_pi: type: string display_order: type: integer MetricsResults: type: object properties: year: type: integer month: type: string instrument_group_name: type: string product_type_name: type: string total_files: type: integer total_bytes: type: integer MetricsYearlyResults: type: object properties: year: type: integer instrument_group_name: type: string product_type_name: type: string total_files: type: integer total_bytes: type: integer Documents: type: object properties: id: type: integer document_name: type: string document_server_location: type: string author: type: string document_type_id: type: integer display_date: type: string upload_date: type: string public: type: boolean data_label: type: string user_id: type: integer document_type_name: type: string UploadDocument: type: object properties: author: type: string document_type_id: type: integer display_date: type: string file: type: string format: binary UploadData: type: object properties: public: type: boolean nearRealTime: type: boolean scanOnly: type: boolean file: type: string format: binary #externalDocs: # description: "external docs description" # url: "http://swagger.io"