Skip to content

List subject

GET https://sciglass.uni-jena.de/api/subject

API for retrieving the Subject Index list.

Query parameters

chapter  string or array  Optional

The chapter name of interest in the Subject Index.


Example request

import asyncio  # (1)!

import httpx
import pandas as pd  # (2)!


# API endpoint
endpoint_url = "https://sciglass.uni-jena.de/api/subject"

headers = {
    "Accept": "application/json",
    "Content-type": "application/json",
    "Authorization": "Bearer $SCIGLASS_NEXT_API_KEY"
}


async def example():
    async with httpx.AsyncClient(timeout=None) as client:
        r = await client.get(endpoint_url, headers=headers)
        if r.status_code == 200:
            data = r.json()
            print(data)

            # Define the desired column order
            columns = ["chapter"]

            # Convert JSON to DataFrame with specified column order
            df = pd.DataFrame(data, columns=columns)

            # Display the DataFrame
            print(df)

            # Export the result to CSV
            df.to_csv('out.csv', index=False)

            # Below is optional with query parameter

            # Find Chapter "Thermal expansion" for example

            params = {"chapter": "Thermal expansion"}
            # params = {"chapter": ["Glass transition temperature", "Thermal expansion"]} # or multiple chapters of interest
            r = await client.get(endpoint_url, headers=headers, params=params)
            if r.status_code == 200:
                data = r.json()
                print(data)
            else:
                print(f"Request failed with status code: {r.status_code}")
                print("Response text:", r.text)
                return

        else:
            print(f"Request failed with status code: {r.status_code}")
            print("Response text:", r.text)


asyncio.run(example())
  1. AsyncIO is Python's built-in library for writing concurrent code with the async/await syntax.
  2. This is optional and is imported in this example to show how to export the result to a CSV file using pandas.
1
2
3
4
curl 'https://sciglass.uni-jena.de/api/subject' \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SCIGLASS_NEXT_API_KEY"

[
  {
    "chapter": "Glass transition temperature" # (1)!
  },
  {
    "chapter": "Thermal expansion"
  },
  {
    "chapter": "Dielectric constant"
  },
  {
    "chapter": "Crystallization"
  },
  {
    "chapter": "Density"
  },
  {
    "chapter": "Transmission"
  },
  {
    "chapter": "Solubility of gases"
  },
  {
    "chapter": "Optical spectra"
  },
  {
    "chapter": "Magnetic susceptibility"
  },
  {
    "chapter": "Diffusion of ions"
  },
  {
    "chapter": "Viscosity"
  },
  {
    "chapter": "Diffusion of gases"
  },
  {
    "chapter": "Strength"
  },
  {
    "chapter": "Chemical durability"
  },
  {
    "chapter": "Volatility"
  },
  {
    "chapter": "Heat capacity"
  },
  {
    "chapter": "Permeation of gases"
  },
  {
    "chapter": "Electrical resistivity"
  },
  {
    "chapter": "Standard points"
  },
  {
    "chapter": "Thermal conductivity"
  },
  {
    "chapter": "Dielectric losses"
  },
  {
    "chapter": "Refractive index"
  },
  {
    "chapter": "Elasticity"
  },
  {
    "chapter": "Internal friction"
  },
  {
    "chapter": "Microhardness"
  }
]
  1. Clicking on the Chapters name in Subject Index window in the Web UI opens related content with query parameter chapter applied.

    The value of the chapter key is exactly the value of the query parameter.

[
  {
    "table_ids": ", 1963, 5246, 7800, 26683, 26729,", # (1)!
    "paragraph": "Structural TEC" # (2)!
  },
  {
    "table_ids": ", 592, 3154, 6353, 9157, 9169, 10049, 11829, 13175, 14663, 20543, 24089,",
    "paragraph": "Influence of water content"
  },
  {
    "table_ids": ", 2697, 2718, 3153, 3160, 4964, 5929, 6307, 7922, 9264, 11410, 12394, 13145, 13405, 15184, 15880, 15973, 17056,",
    "paragraph": "Influence of heat treatment"
  }
]
  1. To get the table IDs, you must split them with a comma and trim.
  2. This is the displayed paragraph name in Subject Index window in the Web UI. Clicking on it opens a list of all tables stored in the key table_ids.

Note

Many table IDs are joined and stored as string in the original SciGlass database, but they are separated by either ,(comma) or (space) or ASCII characters like (This is not space) or \x7f.

The developer is currently keeping it as it was. This decision may change in future updates to improve performance and maintainability.