Get network

Published August 3, 2026

Introduction

This step will guide you on how to get the public and private networks for inference. The PhenoNet platform will return the parameters file_path and task_id, which serve as an identifier for inference.

Request Description

  • API address: https://api.phenonet.org/api/v1/openapi/models/
  • Request method: HTTPS GET
  • Return format: JSON
  • Content-Type: multipart/form-data
  • Headers: {"accessID": "{{STRING}}", "secretKey": "{{STRING}}"}

Parameter Description

parameter data type description value required
accessID string accessID is required when sending requests see Step I: Get AI&SK True
secretKey string secretKey is required when sending requests see Step I: Get AI&SK True

Response Description

json
{
  "code": "{{INTEGER}}",
  "msg": "{{STRING}}",
  "data": {
    "{{NETWORK_ID}}": "{{NETWORK_NAME}}"
  }
}

Returned parameter description

parameter data type description
code integer state code
msg string reference information
data object returned content
network id string network unique identification
network name string -

Example Code

Python

python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests

ACCESS_ID = ''
SECRET_KEY = ''
HEADERS = {
    "accessID": ACCESS_ID,
    "secretKey": SECRET_KEY,
}

def get_network(headers):
    url = "https://api.phenonet.org/api/v1/openapi/models/"
    try:
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as error:
        print(f"Error get networks: {error}")
        return None

if __name__ == '__main__':
    network_res = get_network(HEADERS)
    if network_res:
        print(network_res)

Error Code

code description
403 AI (Access ID) or SK (Secret Key) error