🧪 Periodic Table API

A comprehensive, educational, and developer-friendly REST API providing detailed information about all 119 chemical elements, including 3D models, images, and complete atomic data.

v1.0 • Free & Open Source • JSON Format

Introduction & Use Cases

The Periodic Table API is a robust, production-ready RESTful web service that provides programmatic access to comprehensive data about chemical elements. Built on top of a meticulously curated JSON dataset, this API serves both educational and professional development purposes.

📚

Educational Applications

Build interactive chemistry learning platforms, virtual laboratories, and educational games. Perfect for schools, universities, and online learning platforms.

🔬

Scientific Research Tools

Integrate element data into research applications, molecular modeling software, and chemical analysis tools. Access atomic properties, electron configurations, and physical characteristics.

💻

Developer Projects

Power mobile apps, web applications, data visualization projects, and API mashups. RESTful architecture ensures easy integration with any programming language.

🎨

Interactive Visualizations

Create stunning periodic table interfaces with 3D Bohr models, spectral images, and real element photographs. Includes GLB 3D models for WebGL/AR/VR applications.

📱

Mobile Applications

Build native iOS and Android apps with offline support. Lightweight JSON responses ensure fast performance even on mobile networks.

🌐

International Projects

Support multilingual chemistry education with standardized element symbols and nomenclature. Data includes historical discoverers and naming information.

Key Features

API Endpoint Documentation

Base URL: https://coddoc.xyz/ptapi/api.php

GET https://coddoc.xyz/ptapi/api.php?all=true

Description: Retrieves all 119 elements in the periodic table with complete data for each element.

Response Format:

{
  "count": 119,
  "elements": [
    {
      "name": "Hydrogen",
      "symbol": "H",
      "number": 1,
      "atomic_mass": 1.008,
      "category": "diatomic nonmetal",
      "period": 1,
      "group": 1,
      ...
    }
  ]
}

Use Cases: Full periodic table displays, data exports, offline applications, comprehensive analysis.

GET https://coddoc.xyz/ptapi/api.php?element={value}

Description: Retrieves detailed information about a specific element by name, symbol, or atomic number.

Parameter Type Description Examples
element string/integer Element name, symbol, or atomic number (case-insensitive) Oxygen, O, 8

Example Requests:

// By name
api.php?element=Oxygen

// By symbol
api.php?element=Fe

// By atomic number
api.php?element=79

Response Format:

{
  "name": "Oxygen",
  "symbol": "O",
  "number": 8,
  "atomic_mass": 15.999,
  "appearance": null,
  "category": "diatomic nonmetal",
  "phase": "Gas",
  "period": 2,
  "group": 16,
  "block": "p",
  "electron_configuration": "1s2 2s2 2p4",
  "electron_affinity": 140.976,
  "electronegativity_pauling": 3.44,
  "ionization_energies": [1313.9, 3388.3, ...],
  "density": 1.429,
  "melt": 54.36,
  "boil": 90.188,
  "molar_heat": null,
  "discovered_by": "Carl Wilhelm Scheele",
  "named_by": "Antoine Lavoisier",
  "shells": [2, 6],
  "image": {
    "url": "https://...",
    "title": "...",
    "attribution": "..."
  },
  "bohr_model_image": "https://...",
  "bohr_model_3d": "https://...glb",
  "spectral_img": "https://...",
  "summary": "Oxygen is a chemical element..."
}
GET https://coddoc.xyz/ptapi/api.php?period={number}

Description: Retrieves all elements from a specific period (horizontal row) of the periodic table.

Parameter Type Range Description
period integer 1-8 Period number (1 = first row, 7 = seventh row, 8 = hypothetical eighth row)

Example: https://coddoc.xyz/ptapi/api.php?period=2 returns H, He, Li, Be, B, C, N, O, F, Ne

GET https://coddoc.xyz/ptapi/api.php?group={number}

Description: Retrieves all elements from a specific group (vertical column) of the periodic table.

Parameter Type Range Description
group integer 1-18 Group number (1 = alkali metals, 18 = noble gases)

Example: https://coddoc.xyz/ptapi/api.php?group=17 returns all halogens (F, Cl, Br, I, At, Ts)

GET https://coddoc.xyz/ptapi/api.php?type={category}

Description: Retrieves all elements of a specific chemical category or type.

Parameter Type Description
type string Element category (case-insensitive)

Available Categories:

  • • alkali metal
  • • alkaline earth metal
  • • transition metal
  • • post-transition metal
  • • metalloid
  • • diatomic nonmetal
  • • polyatomic nonmetal
  • • noble gas
  • • lanthanide
  • • actinide

Example: api.php?type=noble%20gas returns He, Ne, Ar, Kr, Xe, Rn, Og

Error Responses

404 Not Found: Element not found

{ "error": "Element not found" }

400 Bad Request: Invalid query parameters

{ "error": "Invalid API request" }

500 Internal Server Error: Server-side issue

{ "error": "pt.json not found" }

API Testing Playground

Test the API endpoints in real-time and see both JSON responses and visual renderings. Select a query type, enter parameters, and click "Execute API Call" to see the results.

JSON Response

// API response will appear here

Visual Rendering

Execute an API call to see the visual representation

Visit Periodic Table