Pagsisimula
Paano magsimulang gumamit ng TCG Price Lookup API sa loob ng 5 minuto.
1. Kumuha ng API Key
Mag-sign up sa tcgpricelookup.com at kunin ang iyong libreng API key mula sa dashboard. Ang libreng plan ay may kasamang 200 requests bawat araw at hindi kailangan ng credit card.
Pagkatapos mag-sign in, pumunta sa seksyon ng Dashboard → API Keys. Ang key ay ganito ang hitsura:
tcg_live_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Panatilihing lihim ang key na ito. Huwag i-commit ito sa version control o ilantad ito sa client-side code.
2. I-install ang SDK
Pumili ng iyong gustong wika at i-install ang official SDK:
# JavaScript / TypeScript
npm install tcglookup
# Python
pip install tcglookup
# Go
go get github.com/TCG-Price-Lookup/tcglookup-go
# Rust
cargo add tcglookup
# PHP
composer require tcg-price-lookup/tcglookup
Awtomatikong hinahawakan ng lahat ng SDK ang authentication, request serialization, error parsing, at rate limit headers.
3. Magpadala ng Unang Request
Narito ang minimal na halimbawa para sa bawat sinusuportahang wika:
// JavaScript / TypeScript
import { TCGLookup } from 'tcglookup';
const tcg = new TCGLookup({ apiKey: 'your-api-key' });
const results = await tcg.search('charizard', { game: 'pokemon', limit: 5 });
console.log(results.data);
// → Array ng card objects na may live market prices
# Python
from tcglookup import TCGLookup
tcg = TCGLookup(api_key='your-api-key')
results = tcg.search('charizard', game='pokemon', limit=5)
print(results.data)
// Go
client := tcglookup.NewClient("your-api-key")
results, _ := client.Search("charizard", &tcglookup.SearchParams{Game: "pokemon"})
4. Suriin ang Response
Ang matagumpay na response ay may ganitong istraktura:
{
"data": [
{
"id": "pokemon-base1-4",
"name": "Charizard",
"game": "pokemon",
"set": { "name": "Base Set", "code": "base1" },
"rarity": "Rare Holo",
"prices": {
"nearMint": {
"market": 450.00,
"tcgplayer": 445.00,
"ebay": 455.00
},
"lightlyPlayed": {
"market": 380.00
}
}
}
],
"total": 12,
"limit": 5,
"offset": 0
}
5. Mga Susunod na Hakbang
- Authentication — Ligtas na paggamit ng API key
- Mga API Endpoint — Lahat ng available na endpoints
- Error Handling — Paano haharapin ang mga error
- Mga SDK at Library — Detalyadong dokumentasyon ng SDK