API မှတ်တမ်း
ပစ္စည်းဒေတာများအတွက်အခမဲ့ REST API ကို။ API ကို key ကိုလိုအပ်ပါတယ်မဟုတ်ပါဘူး။
https://api.periodictableofelements.org
ဒီ API ကိုပုဂ္ဂိုလ်ရေးအတွက်အသုံးပြုရန်အခမဲ့ဖြစ်ပါသည်, ပညာရေး, နှင့်စီးပွားရေးလုပ်ငန်းစီမံကိန်းများ. ကျနော်တို့ကသင်သည်သင်၏ app ကိုသို့မဟုတ် website တွင်တစ်နေရာရာ PeriodicTableOfElements.org သို့ပြန် link ကိုထည့်သွင်းဖို့တောင်းဆို.
ဥပမာ attribution:
<a href="https://periodictableofelements.org">Data from PeriodicTableOfElements.org</a>
သို့မဟုတ် စာသားရိုးရိုးဖြင့်:
Data provided by PeriodicTableOfElements.org
နိဂုံးချုပ်ချက်
အဏုမြူထု, အမျိုးအစား, အီလက်ထရွန် configuration, ပျော်ဝင် / ချက်ပြုတ်ချက်အချက်များအပါအဝင်အဓိကဂုဏ်သတ္တိများနှင့်အတူအားလုံး 118 အကြောင်းအရာများကိုပြန်လာ, နှင့်စားပွဲ layout ကိုများအတွက် grid နေရာများ.
[
{
"atomic_number": 1,
"symbol": "H",
"name": "Hydrogen",
"slug": "hydrogen",
"atomic_mass": 1.008,
"category": "nonmetal",
"block": "s",
"group_number": 1,
"period": 1,
"state_at_room_temp": "gas",
"electronegativity": 2.2,
"ionization_energy": 1312.0,
"electron_affinity": -73.0,
"atomic_radius": 53,
"density": 0.00008988,
"melting_point": 14.01,
"boiling_point": 20.28,
"discovery_year": 1766,
"category_color": "#2ecc71",
"cpk_hex_color": "FFFFFF",
"grid_row": 1,
"grid_column": 1,
"electrons_per_shell": [1],
"electron_configuration_semantic": "1s1"
},
...
]
fetch('https://api.periodictableofelements.org/elements/')
.then(r => r.json())
.then(data => console.log(data));
တစ်ခုတည်းသော element ကိုများအတွက်ပြီးပြည့်စုံသောဒေတာပြန်လာ, အားလုံးနယ်ပယ်များအပါအဝင်: ရုပ်ပိုင်းဆိုင်ရာဂုဏ်သတ္တိများ, တွေ့ရှိချက်သတင်းအချက်အလက်, isotopes, အသုံးပြုမှု, ပျော်စရာအချက်အလက်များ, နှင့်ပိုပြီး။
{
"atomic_number": 79,
"symbol": "Au",
"name": "Gold",
"slug": "gold",
"atomic_mass": 196.9666,
"category": "transition_metal",
"block": "d",
"group_number": 11,
"period": 6,
"state_at_room_temp": "solid",
"electronegativity": 2.54,
"density": 19.3,
"melting_point": 1337.33,
"boiling_point": 3129.0,
"discovery_year": -2500,
"discovered_by": "Ancient civilizations",
"electron_configuration": "1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s1 4f14 5p6 5d10 6s1",
"electron_configuration_semantic": "[Xe] 4f14 5d10 6s1",
"oxidation_states": "+1, +3",
"is_radioactive": false,
"is_synthetic": false,
...
}
fetch('https://api.periodictableofelements.org/elements/79/')
.then(r => r.json())
.then(data => console.log(data));
အကြောင်းအရာများအကြောင်းကို random မေးမြန်းချက်မေးခွန်းကိုပြန်လာ. မေးခွန်းအမျိုးအစားများပါဝင်သည်: သင်္ကေတအမည်, အဏုမြူနံပါတ်ရှာဖွေ, အမျိုးအစားခွဲခြားခြင်း, နှင့် property-based clues.
{
"type": "symbol",
"question": "What element has the symbol Fe?",
"choices": [
{"name": "Iron", "atomic_number": 26},
{"name": "Fluorine", "atomic_number": 9},
{"name": "Francium", "atomic_number": 87},
{"name": "Fermium", "atomic_number": 100}
],
"answer": 26
}
fetch('https://api.periodictableofelements.org/elements/quiz/')
.then(r => r.json())
.then(data => console.log(data));
ဒီနေ့ featured element ကိုပြန်လာ. အဆိုပါ element ကိုနေ့စဉ်ပြောင်းလဲခြင်းနှင့်အားလုံး 118 elements များမှတဆင့်စက်ဘီး. အကျဉ်းချုပ်နှင့်ပျော်စရာဖြစ်ရပ်တစ်ခုပါဝင်သည်.
{
"atomic_number": 6,
"symbol": "C",
"name": "Carbon",
"slug": "carbon",
"category": "nonmetal",
"category_color": "#2ecc71",
"summary": "Carbon is a chemical element...",
"fun_fact": "Carbon can form nearly 10 million different compounds...",
"atomic_mass": 12.011,
"discovery_year": -3750,
"date": "2026-03-29"
}
fetch('https://api.periodictableofelements.org/elements/element-of-the-day/')
.then(r => r.json())
.then(data => console.log(data));
ဓာတုဖော်မြူလာ၏ molar mass ကိုတွက်ချက်သည်။ brackets နှင့် subscripts ကိုထောက်ခံသည် (ဥပမာ၊ Ca (OH)2, H2SO4)။ အက်တမ်အားဖြင့်ခွဲခြမ်းစိတ်ဖြာမှုကိုပြန်လာသည်။
{
"formula": "H2O",
"molar_mass": 18.015,
"breakdown": [
{
"symbol": "H",
"count": 2,
"atomic_mass": 1.008,
"subtotal": 2.016
},
{
"symbol": "O",
"count": 1,
"atomic_mass": 15.999,
"subtotal": 15.999
}
]
}
fetch('https://api.periodictableofelements.org/elements/molar-mass/?formula=H2O')
.then(r => r.json())
.then(data => console.log(data));
အားလုံး downloads 118 formatted JSON file ကိုအဖြစ်အစိတ်အပိုင်းများ. အဏုမြူဂုဏ်သတ္တိများပါဝင်သည်, တွေ့ရှိချက်သတင်းအချက်အလက်, အီလက်ထရွန် configurations, နှင့်ပိုပြီး.
https://api.periodictableofelements.org/elements/export/json/
အားလုံး downloads 118 CSV ဖိုင်အဖြစ်အစိတ်အပိုင်းများ. JSON တင်ပို့အဖြစ်တူညီတဲ့နယ်ပယ်များ, spreadsheets နှင့်ဒေတာခွဲခြမ်းစိတ်ဖြာများအတွက်သင့်လျော်.
https://api.periodictableofelements.org/elements/export/csv/
အမြန်နှုန်း ကနိမ့်ကျမှု
Rate limits are per IP address. အတိုင်းအတာကျော်လွန်ပြန်လာ HTTP 429 (Too Many Requests).
ကုတ်ဥပမာများ
// Fetch all elements fetch('https://api.periodictableofelements.org/elements/') .then(res => res.json()) .then(elements => { console.log(`Loaded ${elements.length} elements`); elements.forEach(el => { console.log(`${el.symbol} - ${el.name} (${el.atomic_mass})`); }); }); // Get a single element fetch('https://api.periodictableofelements.org/elements/79/') .then(res => res.json()) .then(gold => { console.log(`${gold.name}: ${gold.atomic_mass} u`); }); // Calculate molar mass fetch('https://api.periodictableofelements.org/elements/molar-mass/?formula=H2SO4') .then(res => res.json()) .then(data => { console.log(`${data.formula}: ${data.molar_mass} g/mol`); }); // Get element of the day fetch('https://api.periodictableofelements.org/elements/element-of-the-day/') .then(res => res.json()) .then(el => { console.log(`Today's element: ${el.name} (${el.symbol})`); });
# Fetch all elements import requests response = requests.get('https://api.periodictableofelements.org/elements/') elements = response.json() print(f'Loaded {len(elements)} elements') for el in elements: print(f"{el['symbol']} - {el['name']} ({el['atomic_mass']})") # Get a single element gold = requests.get('https://api.periodictableofelements.org/elements/79/').json() print(f"{gold['name']}: {gold['atomic_mass']} u") # Calculate molar mass data = requests.get( 'https://api.periodictableofelements.org/elements/molar-mass/', params={'formula': 'H2SO4'} ).json() print(f"{data['formula']}: {data['molar_mass']} g/mol") # Get element of the day el = requests.get( 'https://api.periodictableofelements.org/elements/element-of-the-day/' ).json() print(f"Today's element: {el['name']} ({el['symbol']})")
အချက်အလက်ကြမ်းကို ဒေါင်းလုပ်လုပ်ပါ
JSON ဖိုင်
အားလုံး 118 အပြည့်အဝအရည်အသွေးများနှင့်အတူအစိတ်အပိုင်းများ. web apps များနှင့်စာသားများအတွက်အလွန်ကောင်းမွန်သော.
JSON ကိုဒေါင်းလုပ်CSV ဖိုင်
Spreadsheet-friendly format ကို။ Excel, Google Sheets, သို့မဟုတ် Pandas တွင်ဖွင့်လှစ်ပါ။
CSV ဖိုင်ကို ဒေါင်းလုပ်လုပ်ပါ