Ticker symbols are the most intuitive way to identify stocks. Everyone knows AAPL is Apple, TSLA is Tesla, and MSFT is Microsoft. This guide shows you how to use ticker symbols to fetch company logos with the Elbstream Logo API.
Fetching a logo by ticker symbol is straightforward:
<img src="https://api.elbstream.com/logos/symbol/AAPL" alt="Apple logo" />
GET https://api.elbstream.com/logos/symbol/{symbol}
| Parameter | Description | Example |
|---|---|---|
symbol | Stock ticker symbol | AAPL, TSLA, GOOGL |
| Parameter | Description | Default |
|---|---|---|
format | Image format: svg, png, jpg, webp | svg |
size | Size in pixels (for non-SVG formats) | 100 |
<!-- Apple logo as SVG -->
<img src="https://api.elbstream.com/logos/symbol/AAPL" alt="Apple" />
<!-- Tesla logo as PNG -->
<img src="https://api.elbstream.com/logos/symbol/TSLA?format=png" alt="Tesla" />
<!-- Microsoft logo as 200x200 PNG -->
<img src="https://api.elbstream.com/logos/symbol/MSFT?format=png&size=200" alt="Microsoft" />
function getLogoUrl(symbol, options = {}) {
const { format = 'svg', size = 100 } = options;
let url = `https://api.elbstream.com/logos/symbol/${symbol}`;
if (format !== 'svg') {
url += `?format=${format}&size=${size}`;
}
return url;
}
// Usage
const appleLogoUrl = getLogoUrl('AAPL');
const teslaLogoPng = getLogoUrl('TSLA', { format: 'png', size: 200 });
function StockLogo({ symbol, size = 48, format = 'svg' }) {
const src = format === 'svg'
? `https://api.elbstream.com/logos/symbol/${symbol}`
: `https://api.elbstream.com/logos/symbol/${symbol}?format=${format}&size=${size}`;
return (
<img
src={src}
alt={`${symbol} logo`}
width={size}
height={size}
/>
);
}
// Usage
<StockLogo symbol="AAPL" />
<StockLogo symbol="TSLA" format="png" size={64} />
<template>
<img :src="logoUrl" :alt="`${symbol} logo`" :width="size" :height="size" />
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
symbol: { type: String, required: true },
format: { type: String, default: 'svg' },
size: { type: Number, default: 48 }
});
const logoUrl = computed(() => {
const base = `https://api.elbstream.com/logos/symbol/${props.symbol}`;
return props.format === 'svg'
? base
: `${base}?format=${props.format}&size=${props.size}`;
});
</script>
| Use Case | Recommended | Why |
|---|---|---|
| User-facing display | Symbol | More recognizable |
| Database storage | ISIN | Globally unique |
| International stocks | ISIN | Symbols can conflict |
| US stocks | Symbol | Simple and familiar |
| ETFs | Either | Both work well |
Be aware that ticker symbols can have conflicts:
CRM on NYSE is SalesforceCRM on other exchanges might be different companiesFor unambiguous identification, consider using ISIN lookups.
Here are some commonly requested symbols:
AAPL - AppleMSFT - MicrosoftGOOGL - Alphabet (Google)AMZN - AmazonMETA - Meta (Facebook)NVDA - NVIDIATSLA - TeslaJPM - JPMorgan ChaseV - VisaJNJ - Johnson & JohnsonWMT - WalmartIf a symbol is not found, the API returns a placeholder. Handle this gracefully:
const img = new Image();
img.onload = function() {
// Logo loaded successfully
document.getElementById('logo').appendChild(img);
};
img.onerror = function() {
// Symbol not found, use fallback
this.src = '/fallback-logo.svg';
};
img.src = `https://api.elbstream.com/logos/symbol/${symbol}`;
The Logo API is free with attribution. Include a visible link:
<a href="https://elbstream.com">Logos provided by Elbstream</a>