> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ycpedia.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Read, generate, and update YCpedia profile articles by LinkedIn ID.

Use the same API for any profile, regardless of its tags.

## Authenticate

Get your customer API key and API base URL from the YCpedia team. Keep the key on your server, outside source control.

Set `YCPEDIA_API_URL` to the supplied API origin, without a trailing slash. The documentation domain is not the API origin.

```bash theme={null}
export YCPEDIA_API_URL="https://api.thealmanac.ai"
export YCPEDIA_API_KEY="YOUR_API_KEY"
```

Every request needs `Authorization: Bearer YOUR_API_KEY`.

## Read an article

Use the slug after `linkedin.com/in/` as the LinkedIn ID.

```bash theme={null}
curl "$YCPEDIA_API_URL/api/v1/articles/jane-doe" \
  -H "Authorization: Bearer $YCPEDIA_API_KEY"
```

A successful response contains `article` and `credits_charged: 1`.
The article includes `title`, `content`, `sources`, `infobox`, version, and timestamps.
`content` is the article text with its original formatting; `sources` contains its citations.
A missing article returns `404` without a charge.

## Generate or update

Generate an article when you need one:

```bash theme={null}
curl -X POST "$YCPEDIA_API_URL/api/v1/articles" \
  -H "Authorization: Bearer $YCPEDIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: generate-jane-doe-001" \
  -d '{"linkedin_id":"jane-doe"}'
```

If the article exists, this returns it immediately for **1 credit**.
Otherwise, it reserves **100 credits** and returns `202` with a `job_id`.

To refresh an existing article, use `POST /api/v1/articles/jane-doe/update` with a new `Idempotency-Key` and no body. An update costs **100 credits**.

## Collect the result

Replace `JOB_ID` with the returned job ID. Poll about every 10 seconds while the status is `queued` or `running`.

```bash theme={null}
curl "$YCPEDIA_API_URL/api/v1/jobs/JOB_ID" \
  -H "Authorization: Bearer $YCPEDIA_API_KEY"
```

When `status` is `succeeded`, use `article` from this response. Polling and reading the job's result are **free**. On `failed` or `cancelled`, stop polling; reserved credits are refunded.

See [credits and retries](/credits-and-retries) for payment and error handling, or the [endpoint reference](/api-reference/read) for full response schemas.
