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

# Downloading files

> The source recording, the protocol, and the transcript as files.

| What | Where to get it | Format |
| - | - | - |
| Source recording | the `url` field in [`info/`](/en/api-reference/audio/info) | file in its original format |
| Protocol | `result.protocol` in [`result/`](/en/api-reference/processing/result) | Markdown |
| Transcript | `result.dialog` in [`result/`](/en/api-reference/processing/result) | JSON |

## Source recording

The `url` field in the `info/` response holds a temporary link to the file in storage. The link is valid for **1 hour**, so request `info/` right before downloading.

```bash theme={null}
URL=$(curl -s "https://api.aigenda.tech/api/spaces/1024/audio/51234/info/" \
  -H "Authorization: Bearer <access>" | jq -r .url)

curl -s -o "standup.mp3" "$URL"
```

You don't need the `Authorization` header to download from the link.

## Protocol in Word or PDF

The API returns the protocol in Markdown. [Pandoc](https://pandoc.org) converts it to DOCX or PDF:

```bash theme={null}
curl -s "https://api.aigenda.tech/api/spaces/1024/audio/51234/result/" \
  -H "Authorization: Bearer <access>" | jq -r .result.protocol > protocol.md

pandoc protocol.md -o protocol.docx
pandoc protocol.md -o protocol.pdf --pdf-engine=xelatex -V mainfont="DejaVu Sans"
```

A PDF with Cyrillic text needs a font with Cyrillic glyphs, which is why the example sets `mainfont`. The protocol comes out in Russian by default.

<Note>
  You can download a ready-made PDF summary in the [web cabinet](https://personal.aigenda.tech/ru).
</Note>

## Transcript

`result.dialog` is a list of meeting blocks with parallel `starts`, `ends`, `speakers`, and `texts` arrays, one element per utterance. Speaker names come from `result.speakers_map`, see [Result structure](/en/processing/result).

A text transcript and SRT subtitles from a finished result:

```python Python theme={null}
def speaker_names(result: dict) -> dict:
    # dialog stores a speaker as "{101}", speakers_map uses the key "101"
    return {f"{{{key}}}": name for key, name in result["speakers_map"].items()}


def to_text(result: dict) -> str:
    names = speaker_names(result)
    lines = []
    for block in result["dialog"]:
        lines.append(f"\n## {block['header']}\n")
        for start, speaker, text in zip(block["starts"], block["speakers"], block["texts"]):
            minutes, seconds = divmod(int(start), 60)
            lines.append(f"[{minutes:02}:{seconds:02}] {names.get(speaker, speaker)}: {text}")
    return "\n".join(lines).strip()


def to_srt(result: dict) -> str:
    def timestamp(value: float) -> str:
        hours, rest = divmod(float(value), 3600)
        minutes, seconds = divmod(rest, 60)
        return f"{int(hours):02}:{int(minutes):02}:{seconds:06.3f}".replace(".", ",")

    names = speaker_names(result)
    cues = []
    for block in result["dialog"]:
        for start, end, speaker, text in zip(block["starts"], block["ends"], block["speakers"], block["texts"]):
            cues.append(f"{len(cues) + 1}\n{timestamp(start)} --> {timestamp(end)}\n{names.get(speaker, speaker)}: {text}\n")
    return "\n".join(cues)


# body is the GET …/result/ response with classified: true
# open("transcript.txt", "w", encoding="utf-8").write(to_text(body["result"]))
# open("transcript.srt", "w", encoding="utf-8").write(to_srt(body["result"]))
```

```text Sample transcript.txt theme={null}
## November sales plan

[00:00] Anna: Let's start with the November plan.
[00:14] SPEAKER_01: We expect the first sign-ups for the new plan in the second week.
[00:31] Anna: Then we need the landing page by October 25.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.