diff --git a/src/routes/api/earnings-call-transcripts/+server.ts b/src/routes/api/earnings-call-transcripts/+server.ts index aa96fbbc..38c31d76 100644 --- a/src/routes/api/earnings-call-transcripts/+server.ts +++ b/src/routes/api/earnings-call-transcripts/+server.ts @@ -9,6 +9,7 @@ export const POST: RequestHandler = async ({ request, locals }) => { quarter: data?.quarter, year: data?.year, }; + const response = await fetch(apiURL + "/earnings-call-transcripts", { method: "POST", headers: { diff --git a/src/routes/stocks/[tickerID]/insider/transcripts/+page.server.ts b/src/routes/stocks/[tickerID]/insider/transcripts/+page.server.ts deleted file mode 100644 index 1925869d..00000000 --- a/src/routes/stocks/[tickerID]/insider/transcripts/+page.server.ts +++ /dev/null @@ -1,38 +0,0 @@ -const now = new Date(); -const year = now?.getFullYear()?.toString(); -const quarter = (Math.floor(now?.getMonth() / 3) + 1)?.toString(); - -export const load = async ({ locals, params }) => { - const getTranscripts = async () => { - let output; - - const { apiKey, apiURL } = locals; - - const postData = { - ticker: params.tickerID, - quarter: quarter, - year: year, - }; - - // make the POST request to the endpoint - const response = await fetch(apiURL + "/earnings-call-transcripts", { - method: "POST", - headers: { - "Content-Type": "application/json", - "X-API-KEY": apiKey, - }, - body: JSON.stringify(postData), - }); - - output = await response.json(); - - return output; - }; - - // Make sure to return a promise - return { - getTranscripts: await getTranscripts(), - quarter, - year, - }; -}; diff --git a/src/routes/stocks/[tickerID]/insider/transcripts/+page.svelte b/src/routes/stocks/[tickerID]/insider/transcripts/+page.svelte index 28b0542b..c5c7ec54 100644 --- a/src/routes/stocks/[tickerID]/insider/transcripts/+page.svelte +++ b/src/routes/stocks/[tickerID]/insider/transcripts/+page.svelte @@ -1,455 +1,349 @@ - - - - - - - - - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} {$displayCompanyName} ({$stockTicker}) · Q{quarter} {year} · Earnings Call Transcript · stocknear - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-

- Transcripts -

+ output = await response.json(); + // Cache the data for this specific tickerID with a specific name 'getTranscripts' + setCache( + `${$stockTicker}-Q-${quarter}-${year}`, + output, + "getTranscripts", + ); + } - -
- - Discover the earnings call highlights and investor Q&A with {$displayCompanyName}! -
+ chats = output?.chat ?? []; + date = output?.date ?? "-"; + displayQuarter = quarter; + displayYear = year; + isLoaded = true; + }; - -
- - - -
- - -
- - {#if isLoaded} - - - {#if chats?.length !== 0} - -
- - Q{displayQuarter} {displayYear} · Earnings Call Transcript - - - {new Date(date).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })} - -
- - - - {#each chats as item} - {#if item?.name === 'Operator'} - -
-
-
- - {item?.name} - -
-
- -
-
-
-

- {@html item?.description} -

-
-
- - - {:else} - -
-
-
- - {item?.name?.slice(0,1)} - -
-
- - {item?.name} - -
-
-
-

- {@html item?.description} -

-
-
- - - {/if} - {/each} - + onMount(async () => { + await getTranscripts(); + }); + - - - {:else} -

- No transcript available for {$displayCompanyName} for the Q{displayQuarter} of {displayYear} 🧐. -

- {/if} - - - - - {:else} -
-
- -
-
- {/if} - -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + {/if} + + + + diff --git a/src/routes/stocks/[tickerID]/statistics/+page.svelte b/src/routes/stocks/[tickerID]/statistics/+page.svelte index 2e21e640..19530337 100644 --- a/src/routes/stocks/[tickerID]/statistics/+page.svelte +++ b/src/routes/stocks/[tickerID]/statistics/+page.svelte @@ -134,7 +134,7 @@ updateYearRange() Total Valuation

Tesla has a market cap or net worth of $832.14 billion. The enterprise value is $812.05 billion. @@ -169,7 +169,7 @@ updateYearRange() Important Dates

The last earnings date was Wednesday, October 23, 2024, after market close. @@ -201,7 +201,7 @@ updateYearRange() Share Statistics

Tesla has 3.19 billion shares outstanding. The number of shares has increased by 0.31% in one year. @@ -265,7 +265,7 @@ updateYearRange() Valuation Ratios

The trailing PE ratio is 71.41 and the forward PE ratio is 86.99. Tesla's PEG ratio is 5.94. @@ -344,7 +344,7 @@ updateYearRange() Enterprise Valuation

The stock's EV/EBITDA ratio is 61.31, with an EV/FCF ratio of 224.95. @@ -400,7 +400,7 @@ updateYearRange() Financial Position

The company has a current ratio of 1.84, with a Debt / Equity ratio of 0.18. @@ -464,7 +464,7 @@ updateYearRange() Financial Efficiency

Return on equity (ROE) is 20.39% and return on invested capital (ROIC) is 6.96%. @@ -573,7 +573,7 @@ updateYearRange() Stock Price Statistics

The stock price has increased by +22.82% in the last 52 weeks. The beta is 2.30, so Tesla's price volatility has been higher @@ -638,7 +638,7 @@ updateYearRange() Short Selling Information

The latest short interest is 74.33 million, so 2.33% of the outstanding shares have been sold short. @@ -694,7 +694,7 @@ updateYearRange() Income Statement

In the last 12 months, Tesla had revenue of $97.15 billion and earned $12.74 billion in profits. Earnings per share was $3.65. @@ -783,7 +783,7 @@ updateYearRange() Balance Sheet

The company has $33.65 billion in cash and $12.78 billion in debt, giving a net cash position of $20.87 billion or $6.53 per @@ -862,7 +862,7 @@ updateYearRange() Cash Flow

In the last 12 months, operating cash flow was $14.48 billion and capital expenditures -$10.87 billion, giving a free cash @@ -915,7 +915,7 @@ updateYearRange()

Margins

Gross margin is 18.23%, with operating and profit margins of 8.38% and 13.07%.