Skip to main content

Periodic table and chemistry reference API client — chemfyi.com

Project description

chemfyi

PyPI version Python License: MIT Zero Dependencies

Python API client and CLI for the periodic table, chemical compounds, and reactions. Access 118 elements with full electron configurations and physical properties, 500 compounds with molecular formulas and IUPAC names, 371 chemical reactions with balanced equations, and 95 interactive experiments — all with zero dependencies.

Extracted from ChemFYI, a chemistry reference platform with 244 glossary terms, 250 educational guides, and interactive tools for students, educators, and developers exploring the periodic table and chemical sciences.

Explore chemistry at chemfyi.com — browse the periodic table, look up compounds, study reactions, and read the chemistry glossary.

chemfyi demo — periodic table lookup, element properties, and compound search in Python

Table of Contents

Install

pip install chemfyi                # Core (zero deps)
pip install "chemfyi[cli]"         # + Command-line interface (typer, rich)
pip install "chemfyi[mcp]"         # + MCP server for AI assistants
pip install "chemfyi[api]"         # + HTTP client for chemfyi.com API
pip install "chemfyi[all]"         # Everything

Or run instantly without installing:

uvx --from chemfyi chemfyi search oxygen

Quick Start

from chemfyi.api import ChemFYI

with ChemFYI() as api:
    # Look up any of the 118 elements by slug
    hydrogen = api.get_element("hydrogen")
    print(hydrogen["symbol"])                  # H
    print(hydrogen["atomic_number"])           # 1
    print(hydrogen["atomic_mass"])             # 1.008
    print(hydrogen["electron_configuration"])  # 1s1

    # Search across elements, compounds, and reactions
    results = api.search("carbon dioxide")
    print(results["count"])  # Number of matches

    # List all compounds with pagination
    compounds = api.list_compounds(limit=10)
    print(compounds["count"])  # 500 total compounds

What You Can Do

Periodic Table & Elements

The periodic table organizes all 118 confirmed elements by atomic number, electron configuration, and recurring chemical properties. Elements are arranged in 18 groups (columns) and 7 periods (rows), with the lanthanides and actinides forming two additional rows. ChemFYI provides complete data for every element.

Category Count Examples
Alkali Metals 6 Lithium (Li), Sodium (Na), Potassium (K)
Alkaline Earth Metals 6 Beryllium (Be), Magnesium (Mg), Calcium (Ca)
Transition Metals 38 Iron (Fe), Copper (Cu), Gold (Au), Platinum (Pt)
Post-Transition Metals 7 Aluminum (Al), Tin (Sn), Lead (Pb)
Metalloids 6 Silicon (Si), Germanium (Ge), Arsenic (As)
Nonmetals 7 Carbon (C), Nitrogen (N), Oxygen (O), Sulfur (S)
Halogens 5 Fluorine (F), Chlorine (Cl), Bromine (Br), Iodine (I)
Noble Gases 7 Helium (He), Neon (Ne), Argon (Ar), Krypton (Kr)
Lanthanides 15 Cerium (Ce), Neodymium (Nd), Europium (Eu)
Actinides 15 Uranium (U), Plutonium (Pu), Thorium (Th)

Each element includes atomic mass, density, melting/boiling points, electron configuration, electronegativity (Pauling scale), ionization energy, and electron affinity.

from chemfyi.api import ChemFYI

with ChemFYI() as api:
    # Retrieve complete element data — all 118 elements available
    iron = api.get_element("iron")
    print(iron["symbol"])                  # Fe
    print(iron["atomic_number"])           # 26
    print(iron["atomic_mass"])             # 55.845
    print(iron["electron_configuration"])  # [Ar] 3d6 4s2
    print(iron["electronegativity"])       # 1.83
    print(iron["phase_at_stp"])            # Solid
    print(iron["block"])                   # d
    print(iron["group_number"])            # 8
    print(iron["period"])                  # 4

Learn more: Periodic Table · Chemistry Glossary · Chemistry Guides

Chemical Compounds

ChemFYI catalogs 500 chemical compounds with molecular formulas, IUPAC nomenclature, structural information, and physical properties. Compounds span inorganic salts, organic molecules, acids, bases, and coordination complexes.

from chemfyi.api import ChemFYI

with ChemFYI() as api:
    # Browse the compound database — 500 compounds indexed
    compounds = api.list_compounds(limit=5)
    for compound in compounds["results"]:
        print(compound["slug"], compound.get("name", ""))

    # Get detailed compound information
    detail = api.get_compound("sodium-chloride")
    print(detail)

Learn more: Compounds Database · Chemistry Guides

Chemical Reactions

Explore 371 chemical reactions with balanced equations, reaction types (synthesis, decomposition, single replacement, double replacement, combustion, redox), and practical applications. Each reaction includes reactants, products, and conditions.

from chemfyi.api import ChemFYI

with ChemFYI() as api:
    # Browse reactions — 371 reactions with balanced equations
    reactions = api.list_reactions(limit=5)
    for rxn in reactions["results"]:
        print(rxn["slug"])

    # Search for specific reaction types
    combustion = api.search("combustion")
    print(combustion["count"])

Learn more: Reactions Database · Chemistry Glossary

Interactive Experiments

ChemFYI includes 95 interactive experiments with step-by-step procedures, safety guidelines, and expected observations — designed for chemistry education from high school through university level.

from chemfyi.api import ChemFYI

with ChemFYI() as api:
    # Browse 95 experiments with detailed procedures
    experiments = api.list_experiments(limit=5)
    for exp in experiments["results"]:
        print(exp["slug"])

Learn more: Experiments · Chemistry Guides

Command-Line Interface

pip install "chemfyi[cli]"

chemfyi search oxygen                # Search elements, compounds, reactions
chemfyi search "sulfuric acid"       # Search compounds by name
chemfyi search combustion            # Search reactions by type

MCP Server (Claude, Cursor, Windsurf)

Add chemistry lookup tools to any AI assistant that supports Model Context Protocol.

pip install "chemfyi[mcp]"

Add to your claude_desktop_config.json:

{
    "mcpServers": {
        "chemfyi": {
            "command": "uvx",
            "args": ["--from", "chemfyi[mcp]", "python", "-m", "chemfyi.mcp_server"]
        }
    }
}

REST API Client

pip install "chemfyi[api]"
from chemfyi.api import ChemFYI

with ChemFYI() as api:
    elements = api.list_elements()          # GET /api/v1/elements/
    hydrogen = api.get_element("hydrogen")  # GET /api/v1/elements/hydrogen/
    compounds = api.list_compounds()        # GET /api/v1/compounds/
    reactions = api.list_reactions()         # GET /api/v1/reactions/
    results = api.search("oxygen")          # GET /api/v1/search/?q=oxygen

Example

curl -s "https://chemfyi.com/api/v1/elements/hydrogen/"
{
  "atomic_number": 1,
  "symbol": "H",
  "slug": "hydrogen",
  "category": "nonmetal",
  "atomic_mass": 1.008,
  "electron_configuration": "1s1",
  "electronegativity": 2.2,
  "phase_at_stp": "Gas",
  "block": "s",
  "group_number": 1,
  "period": 1
}

Full API documentation at chemfyi.com/developers/.

API Reference

Method Description
list_elements(**params) List all 118 elements with pagination
get_element(slug) Get element by slug (e.g., "hydrogen", "iron")
list_compounds(**params) List all 500 compounds
get_compound(slug) Get compound detail
list_reactions(**params) List all 371 reactions
get_reaction(slug) Get reaction detail with balanced equation
list_experiments(**params) List all 95 experiments
get_experiment(slug) Get experiment detail with procedures
list_categories(**params) List element categories
get_category(slug) Get category detail
list_applications(**params) List industrial applications
get_application(slug) Get application detail
list_glossary(**params) List 244 chemistry glossary terms
get_term(slug) Get glossary term definition
list_guides(**params) List 250 educational guides
get_guide(slug) Get guide content
search(query) Search across all chemistry content

Learn More About Chemistry

Also Available

Platform Install Link
npm npm install chemfyi npm
MCP uvx --from "chemfyi[mcp]" python -m chemfyi.mcp_server Config

Science FYI Family

Part of the FYIPedia open-source developer tools ecosystem — physical sciences, chemistry, geology, astronomy, and materials.

Package PyPI npm Description
chemfyi PyPI npm Periodic table, 500 compounds, 371 reactions — chemfyi.com
alloyfyi PyPI npm 765 metal alloys, 12 families, compositions — alloyfyi.com
gemfyi PyPI npm 442 gemstones, Mohs scale, grading — gemfyi.com
starfyi PyPI npm 119,602 stars, 6,128 exoplanets, 13,305 deep-sky objects — starfyi.com
mineralfyi PyPI npm 6,215 minerals, 7 crystal systems — mineralfyi.com

FYIPedia Developer Tools

Package PyPI npm Description
colorfyi PyPI npm Color conversion, WCAG contrast, harmonies — colorfyi.com
emojifyi PyPI npm Emoji encoding & metadata for 3,953 emojis — emojifyi.com
symbolfyi PyPI npm Symbol encoding in 11 formats — symbolfyi.com
unicodefyi PyPI npm Unicode lookup with 17 encodings — unicodefyi.com
fontfyi PyPI npm Google Fonts metadata & CSS — fontfyi.com
distancefyi PyPI npm Haversine distance & travel times — distancefyi.com
timefyi PyPI npm Timezone ops & business hours — timefyi.com
namefyi PyPI npm Korean romanization & Five Elements — namefyi.com
unitfyi PyPI npm Unit conversion, 220 units — unitfyi.com
holidayfyi PyPI npm Holiday dates & Easter calculation — holidayfyi.com
cocktailfyi PyPI Cocktail ABV, calories, flavor — cocktailfyi.com
fyipedia PyPI Unified CLI: fyi chem info hydrogenfyipedia.com
fyipedia-mcp PyPI Unified MCP hub for AI assistants — fyipedia.com

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chemfyi-0.1.1.tar.gz (557.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chemfyi-0.1.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file chemfyi-0.1.1.tar.gz.

File metadata

  • Download URL: chemfyi-0.1.1.tar.gz
  • Upload date:
  • Size: 557.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chemfyi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc189c62429e0923b4f35087f1504195678e4a58221b4292403d708530da4219
MD5 9db12a0583b27e5ca42bf39f57012bdb
BLAKE2b-256 eb6748cb01d5b1d165d8a065bda0559bddd2f29f107b12256813be88dbd93d43

See more details on using hashes here.

File details

Details for the file chemfyi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chemfyi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chemfyi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29594e2346cc574c53e15d2538b011aa2c32d653bd6551c939662859705bae7b
MD5 1dc22d43aeda15a07de15013c8ab1b6d
BLAKE2b-256 14b0fb031f14dbe0d87c431ac23e07577ed05d0b3343db7c22839412fe50a99c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page