Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.
Was this page helpful?
⌘I
{"docsConfig":{"theme":"almond","$schema":"https://mintlify.com/docs.json","name":"Perplexity","description":"Perplexity API docs. Search: ranked web results with extracted page text for your own model. Agent: hosted models with web search and tools, returning a cited answer. Decisions: calibrated probabilities. Orchestrator (private preview): OpenAI- and Anthropic-format routing. Embeddings: vectors.","colors":{"primary":"#121516","light":"#F7F7F8","dark":"#121516"},"logo":{"light":"https://mintcdn.com/perplexity/gHf_T6roVjp3yaJv/logo/Perplexity_API_Platform.svg?fit=max\u0026auto=format\u0026n=gHf_T6roVjp3yaJv\u0026q=85\u0026s=07cab879ca2ce031bbc3da8b20f7ab90","dark":"https://mintcdn.com/perplexity/gHf_T6roVjp3yaJv/logo/Perplexity_API_Platform_Light.svg?fit=max\u0026auto=format\u0026n=gHf_T6roVjp3yaJv\u0026q=85\u0026s=416d5342d11094201b851dcf3eabdc9d","href":"/docs/getting-started/overview"},"favicon":"https://mintcdn.com/perplexity/1nonjPul2rlRMt-c/favicon.png?fit=max\u0026auto=format\u0026n=1nonjPul2rlRMt-c\u0026q=85\u0026s=f095c28dbad15e333c62683681f3ec20","api":{"examples":{"defaults":"required"}},"background":{"color":{"light":"#F7F7F8","dark":"#121516"}},"navbar":{"primary":{"type":"button","label":"Get Started","href":"https://console.perplexity.ai"}},"footer":{"socials":{"x":"https://x.com/perplexitydevs","discord":"https://discord.com/invite/perplexity-ai","website":"https://community.perplexity.ai"}},"search":{"prompt":"Search"},"seo":{"metatags":{"google-site-verification":"l-0uTKc1Uf60LaNt0Pkw1wLOBFEKoBIhUrv0EMr1J4U"},"indexing":"navigable"},"fonts":{"family":"GT Standard","weight":300,"source":"fonts/GT-Standard-S-Standard-Light.woff2","format":"woff2"},"icons":{"library":"tabler"},"banner":{"content":"For AI agents: see the complete [llms.txt](/llms.txt) documentation index.","dismissible":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"The page you're looking for doesn't exist. Try the [documentation home](/docs/getting-started/overview) or search above."}},"contextual":{"options":["copy","view","perplexity"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":false},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":{"style":"regular","name":"message-circle"},"href":"https://community.perplexity.ai"},{"anchor":"Blog","icon":{"style":"regular","name":"pencil"},"href":"https://research.perplexity.ai/articles"},{"anchor":"Changelog","icon":{"style":"regular","name":"clock"},"href":"/docs/resources/changelog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"perplexity","hasAudioNarration":false,"actualSubdomain":"perplexity","customDomains":["docs.perplexity.ai"],"gitSource":{"type":"github","owner":"ppl-ai","repo":"api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae28c0332bbaa8efe89964a","collectionId":"da06ebe9-510c-4e57-aaf8-f4b5711360ca","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae28c0332bbaa8efe89964a"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae28c0332bbaa8efe89964a","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Docs","count":102},{"language":"default","tag":"Cookbook","count":88},{"language":"default","tag":"Agent API","count":55},{"language":"default","tag":"API Reference","count":36},{"language":"default","tag":"Examples","count":28},{"language":"default","tag":"Resources","count":28},{"language":"default","tag":"Integrations","count":21},{"language":"default","tag":"Guides","count":18},{"language":"default","tag":"Search API","count":13},{"language":"default","tag":"Tools","count":10}]},"assistantConfig":{"enableStarterQuestions":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"6983db9dfb7ad2556f59e58e","deploymentId":"65a9ccde8bfbe120a55f6d5b","questionText":"What is the Agent API?","status":"active","generatedBy":"manual","createdAt":"2026-02-04T23:51:57.148Z","updatedAt":"2026-02-13T03:11:32.396Z","__v":0},{"_id":"6983db84fb7ad2556f59e4ee","deploymentId":"65a9ccde8bfbe120a55f6d5b","questionText":"Which Agent API model should I use?","status":"active","generatedBy":"manual","createdAt":"2026-02-04T23:51:32.666Z","updatedAt":"2026-02-13T03:11:40.522Z","__v":0},{"_id":"6983db82fb7ad2556f59e4e1","deploymentId":"65a9ccde8bfbe120a55f6d5b","questionText":"How do I create an API key?","status":"active","generatedBy":"manual","createdAt":"2026-02-04T23:51:30.248Z","updatedAt":"2026-02-06T16:17:57.191Z","__v":0}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"@font-face{font-family:\"GT Standard\";src:url(/fonts/GT-Standard-S-Standard-Light.woff2) format(\"woff2\");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:\"GT Standard\";src:url(/fonts/GT-Standard-S-Standard-Regular.woff2) format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"GT Standard\";src:url(/fonts/GT-Standard-S-Standard-Medium.woff2) format(\"woff2\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"GT Standard\";src:url(/fonts/GT-Standard-M-Standard-Medium.woff2) format(\"woff2\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"GT Standard\";src:url(/fonts/GT-Standard-M-Standard-Semibold.woff2) format(\"woff2\");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:\"GT Standard\";src:url(/fonts/GT-Standard-L-Standard-Medium.woff2) format(\"woff2\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"GT Standard Mono\";src:url(/fonts/GT-Standard-Mono-Standard-Regular.woff2) format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}.font-mono,kbd,pre,samp{font-family:\"GT Standard Mono\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}:root{--color-primary:#121516;--color-paperwhite:#fbfaf4;--color-ecru:#F7F7F8;--color-offblack:#121516;--color-dark-turquoise-dark:rgba(34, 128, 140, 0.7);--color-dark-turquoise-light:rgba(44, 160, 171, 1);--color-foreground:#121516;--color-muted-foreground:#6b7280;--color-card:#F7F7F8;--color-border:#DBDDDE;--cb-agent-api-fg:#1a7a85;--cb-agent-api-bg:rgba(34, 128, 140, 0.12);--cb-search-api-fg:#2f6fae;--cb-search-api-bg:rgba(47, 111, 174, 0.12);--cb-embeddings-api-fg:#b05f2e;--cb-embeddings-api-bg:rgba(176, 95, 46, 0.12);--cb-sonar-api-fg:#977621;--cb-sonar-api-bg:rgba(157, 118, 52, 0.16);--cb-decisions-api-fg:#944454;--cb-decisions-api-bg:rgba(148, 68, 84, 0.12);--cb-category-fg:#475569;--cb-category-bg:rgba(71, 85, 105, 0.10);--cb-type-fg:#6b7280;--cb-type-bg:rgba(107, 114, 128, 0.10);--cb-popover-bg:#ffffff;--cb-popover-border:#e5e7eb;--cb-hover:rgba(18, 21, 22, 0.05);--cb-accent-fg:#1a7a85;--sonar-bg:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarbgmainlight.svg\");--reasoning-bg:url(\"https://mintlify-assets.b-cdn.net/perplexity/reasoningbgmainlight.svg\");--deep-research-bg:url(\"https://mintlify-assets.b-cdn.net/perplexity/deepbgmainlight.svg\");--sonar-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarmodelbannerlight.svg\");--sonar-pro-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarpromodelbannerlight.svg\");--sonar-reasoning-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarreasoningbannerlight.svg\");--sonar-reasoning-pro-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarreasoningprobannerlight.svg\");--sonar-deep-research-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonardeepbannerlight.svg\");--search-api-banner:url(\"https://docs.perplexity.ai/models/assets/search_api.png\");--sonar-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarbglight.svg\");--sonar-pro-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarprobglight.svg\");--reasoning-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/reasoningbglight.svg\");--reasoning-pro-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/reasoningprobglight.svg\");--deep-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/deepbglight.svg\")}.dark{--color-primary:#F7F7F8;--color-foreground:#F7F7F8;--color-muted-foreground:#9ca3af;--color-card:rgba(8, 31, 34, 0.3);--color-border:rgba(247, 247, 248, 0.2);--cb-agent-api-fg:#4aa6af;--cb-agent-api-bg:rgba(53, 189, 200, 0.16);--cb-search-api-fg:#6aa8e0;--cb-search-api-bg:rgba(76, 140, 210, 0.18);--cb-embeddings-api-fg:#e0915f;--cb-embeddings-api-bg:rgba(200, 120, 60, 0.22);--cb-sonar-api-fg:#cda456;--cb-sonar-api-bg:rgba(200, 160, 70, 0.20);--cb-decisions-api-fg:#d17f90;--cb-decisions-api-bg:rgba(200, 120, 140, 0.22);--cb-category-fg:#cbd5e1;--cb-category-bg:rgba(148, 163, 184, 0.18);--cb-type-fg:#9ca3af;--cb-type-bg:rgba(156, 163, 175, 0.16);--cb-popover-bg:#15191a;--cb-popover-border:rgba(247, 247, 248, 0.14);--cb-hover:rgba(247, 247, 248, 0.08);--cb-accent-fg:#4aa6af;--sonar-bg:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarbgmain.svg\");--reasoning-bg:url(\"https://mintlify-assets.b-cdn.net/perplexity/reasoningbgmain.svg\");--deep-research-bg:url(\"https://mintlify-assets.b-cdn.net/perplexity/deepbgmain.svg\");--sonar-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarmodelbanner.svg\");--sonar-pro-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarpromodelbanner.svg\");--sonar-reasoning-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarreasoningbanner.svg\");--sonar-reasoning-pro-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarreasoningprobanner.svg\");--sonar-deep-research-banner:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonardeepbanner.svg\");--search-api-banner:url(\"https://docs.perplexity.ai/models/assets/search_api.png\");--sonar-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarbg.svg\");--sonar-pro-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/sonarprobg.svg\");--reasoning-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/reasoningbg.svg\");--reasoning-pro-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/reasoningprobg.svg\");--deep-sq:url(\"https://mintlify-assets.b-cdn.net/perplexity/deepbg.svg\")}h1{font-size:32px;line-height:38px;letter-spacing:.01em;color:#000}h2{font-size:28px;line-height:32px}h3{font-size:22px;line-height:26px}h4{font-weight:600;font-size:18px;line-height:21px}body,h1,h2,h3,h4,h5,h6{font-family:\"GT Standard\",sans-serif}h2,h3,h4,h5,h6{letter-spacing:-.02em}h5{font-size:17px;line-height:22px;color:rgba(18,21,22,.9)}h6{font-size:15px;line-height:17px}.dark h1{color:#fff}.dark .content a:hover,.dark .paragraph-small a:hover,.dark .text-sm a:hover,.dark article a:hover,.dark h2,.dark h3,.dark h4,.dark h6,.dark li a:hover,.dark main a:hover,.dark p a:hover{color:#f7f7f8}.dark h5{color:rgba(247,247,248,.9)}.mdx-content li,.prose [data-as=p],.prose span[data-as=p],p{font-family:\"GT Standard\",sans-serif;font-weight:300;font-size:16px;line-height:140%;letter-spacing:-.03em;color:#545658}.paragraph-large,.text-lg{font-weight:300;font-size:18px;line-height:140%;letter-spacing:-.03em;color:#545658}.font-medium,b,h1,h2,h3,h5,h6,strong{font-weight:500}.paragraph-small,.paragraph-xs,.text-sm,.text-xs{font-weight:300;font-size:14px;line-height:140%;letter-spacing:-.03em;color:#545658}.paragraph-xs,.text-xs{font-weight:400;font-size:13px}.dark .mdx-content li,.dark .paragraph-large,.dark .paragraph-small,.dark .paragraph-xs,.dark .prose [data-as=p],.dark .prose span[data-as=p],.dark .text-lg,.dark .text-sm,.dark .text-xs,.dark p{color:#abb0b3}.content a,article a,main a{text-decoration:underline}.content a,article a,li a,main a,p a{font-family:\"GT Standard\",sans-serif;font-weight:400;color:rgba(18,21,22,.6);transition:color .2s ease}.content a:hover,article a:hover,h2,h3,h4,h6,li a:hover,main a:hover,p a:hover{color:#121516}.dark .content a,.dark article a,.dark li a,.dark main a,.dark p a{color:rgba(247,247,248,.6)}html[data-current-path=\"/docs/cookbook\"] #page-context-menu{display:none!important}.cb-chip:hover{background-color:var(--cb-hover)}.dark .paragraph-small a,.dark .text-sm a{color:#abb0b3}[data-component-part=callout-content] a,[data-component-part=card-content] a,[data-component-part=step-content] a,a.link,li a,p a,span a{border-bottom:none!important;text-decoration:underline!important;text-decoration-thickness:1px!important;text-underline-offset:2px!important}a.model-card-link{border-bottom-width:1px!important;border-bottom-style:solid!important;border-bottom-color:var(--color-border)!important}a.model-card-link:hover{border-bottom-color:var(--color-primary)!important}#content-area li a.cookbook-card,#navbar a,.almond-layout .sidebar-group a,.almond-layout a,a.model-card-link{text-decoration:none!important}#content-area [data-component-part=callout-content] a,#content-area [data-component-part=card-content] a,#content-area [data-component-part=step-content] a,#content-area a.link,#content-area li a,#content-area p a,#content-area td a{text-decoration:underline!important;text-decoration-thickness:1px!important;text-underline-offset:2px!important}#topbar-cta-button a,#topbar-cta-button a span{font-family:\"GT Standard\",sans-serif!important;font-weight:500!important;color:#f7f7f8!important}#topbar-cta-button a,.dark #topbar-cta-button a{background-color:#1a6872!important}#topbar-cta-button{margin-right:36px!important}.dark code,code{padding:4px 8px;border-radius:4px}code{font-family:\"GT Standard Mono\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-weight:400;font-size:13px;line-height:18px;letter-spacing:-.02em;color:#545658!important;background-color:rgba(18,21,22,.04)!important}.dark code{color:#f7f7f8!important;background-color:rgba(247,247,248,.04)!important}#navbar a img{max-width:165px}#navbar .group .absolute.bg-primary{background-color:var(--color-primary)}.text-5xl{font-size:3rem}.text-paperwhite{color:var(--color-paperwhite)}.text-ecru{color:var(--color-ecru)}.text-offblack{color:var(--color-offblack)}.bg-dark-turquoise{background-color:var(--color-dark-turquoise-light)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.bg-card{background-color:var(--color-card)}.border-border{border-color:var(--color-border)}.text-primary{color:var(--color-primary)}.border-primary{border-color:var(--color-primary)}.hover\\:bg-primary\\/90:hover{background-color:rgba(34,128,140,.9)}.bg-primary{background-color:var(--color-primary)}.hover\\:border-primary\\/30:hover{border-color:rgba(34,128,140,.3)}.bg-primary\\/10{background-color:rgba(34,128,140,.1)}.bg-button-active{background-color:#92dce2}.bg-button-primary{background-color:#35bdc8}.bg-quickstart{background-color:#1a6872}.bg-search-box{background-color:rgba(222,247,249,.03)}.border-search-box{border-color:rgba(222,247,249,.3)}.bg-nav-selected{background-color:rgba(247,247,248,.1)}.bg-command-key{background-color:rgba(32,128,141,.3)}.text-command-key{color:rgba(222,247,249,.7)}.text-dark-primary{color:#121516}.btn-default{background-color:#121516;color:#f7f7f8;border-radius:9999px;padding:.75rem 1.5rem;font-weight:500;font-size:1rem;text-align:center;white-space:nowrap;transition:all .2s ease;display:inline-block;text-decoration:none;border:0;cursor:pointer}.btn-default:hover{background-color:#0b0c0d}.btn-outline,.dark .btn-default{background-color:#f7f7f8;color:#121516}.dark .btn-default:hover{background-color:#fff}.btn-outline{background-color:transparent;border:2px solid #121516;border-radius:9999px;padding:.75rem 1.5rem;font-weight:500;font-size:1rem;text-align:center;white-space:nowrap;transition:all .2s ease;display:inline-block;text-decoration:none;cursor:pointer}.btn-outline:hover{background-color:rgba(18,21,22,.06)}.dark .btn-outline{color:#f7f7f8;border-color:#f7f7f8}.dark .btn-outline:hover{background-color:rgba(247,247,248,.14)}.code-group.dark\\:text-gray-50:is(.dark *){background:rgba(8,31,34,.3);border-radius:12px;padding:1rem}.code-group.text-gray-950{border-radius:12px;padding:1rem}[id^=usecase-panel-] .code-group{margin:0!important;border:0!important}#navbar .ml-auto{margin-left:0!important;position:absolute!important;left:calc(50% + 92px)!important;transform:translateX(-50%)!important;width:auto!important;flex:none!important}#navbar .nav-tabs,.nav-tabs-item{display:flex!important;gap:24px!important;align-items:center!important}.nav-tabs-item{padding:10px 30px!important;justify-content:center!important;gap:10px!important;font-family:\"GT Standard\",sans-serif!important;font-size:13px!important;font-weight:400!important;letter-spacing:-.52px!important;line-height:normal!important;border-radius:100px!important;transition:all .2s ease!important;height:auto!important}.nav-tabs-item.text-gray-800{background-color:rgba(18,21,22,.06)!important}.dark .nav-tabs-item.dark\\:text-gray-200{background-color:rgba(247,247,248,.14)!important}.nav-tabs-item:hover:not([aria-current=page]):not(.active){background-color:rgba(18,21,22,.04)!important}.dark .nav-tabs-item:hover:not([aria-current=page]):not(.active){background-color:rgba(247,247,248,.08)!important}#table-of-contents>button span,.nav-tabs-item .absolute.bg-primary,.nav-tabs-item>.absolute{display:none!important}.dark,.dark #navbar,.dark .almond-layout,.dark .almond-layout>div,.dark .almond-layout>div>div,.dark .code-block,.dark .code-group,.dark [class*=\"bg-[#09090B]\"],.dark [class*=bg-gray-950]{background-color:#121516!important}.code-block,.code-group{background-color:#f7f7f8!important}.code-block pre,.code-block-background,.code-group pre,pre.shiki{background-color:#fff!important}.dark .code-block pre,.dark .code-block-background,.dark .code-group pre,.dark pre.shiki{background-color:#0b0c0d!important}.code-block code,.code-group code,.dark .code-block code,.dark .code-group code,.table tr{background-color:transparent!important}.homepage-code-block .code-group,.homepage-code-block .code-group pre{border-radius:6px!important}.callout{padding:16px 24px 16px 16px!important;border-radius:12px!important;border-width:1px!important;border-style:solid!important;gap:12px!important;overflow:visible!important}.callout [data-component-part=callout-icon]{margin-top:0!important}.callout [data-component-part=callout-content]{font-family:\"GT Standard\",sans-serif!important;font-weight:300!important;font-size:14px!important;letter-spacing:-.02em!important;line-height:140%!important}.callout [data-component-part=callout-content] [data-as=p],.callout [data-component-part=callout-content] p{margin-bottom:12px!important}#section-menu-dropdown .toc-item:last-child a,.callout [data-component-part=callout-content] [data-as=p]:last-child,.callout [data-component-part=callout-content] p:last-child{margin-bottom:0!important}.callout[data-callout-type=note]{background-color:rgba(66,145,210,.1)!important;border-color:rgba(66,145,210,.14)!important}.callout[data-callout-type=note] [data-component-part=callout-content],.callout[data-callout-type=note] [data-component-part=callout-icon] svg{color:#135b8c!important}.dark .callout[data-callout-type=note]{background-color:rgba(66,145,210,.18)!important;border-color:rgba(66,145,210,.18)!important}.dark .callout[data-callout-type=note] [data-component-part=callout-content],.dark .callout[data-callout-type=note] [data-component-part=callout-icon] svg{color:#63aef2!important}.callout[data-callout-type=info]{background-color:rgba(18,21,22,.06)!important;border-color:rgba(18,21,22,.1)!important}.callout[data-callout-type=info] [data-component-part=callout-content],.callout[data-callout-type=info] [data-component-part=callout-icon] svg{color:#545658!important}.dark .callout[data-callout-type=info]{background-color:rgba(247,247,248,.1)!important;border-color:rgba(247,247,248,.14)!important}.dark #header .text-lg.prose p,.dark .callout[data-callout-type=info] [data-component-part=callout-content],.dark .callout[data-callout-type=info] [data-component-part=callout-icon] svg{color:#abb0b3!important}.callout[data-callout-type=tip]{background-color:rgba(75,158,79,.1)!important;border-color:rgba(75,158,79,.14)!important}.callout[data-callout-type=tip] [data-component-part=callout-content],.callout[data-callout-type=tip] [data-component-part=callout-icon] svg{color:#136a22!important}.dark .callout[data-callout-type=tip]{background-color:rgba(75,158,79,.18)!important;border-color:rgba(75,158,79,.22)!important}.dark .callout[data-callout-type=tip] [data-component-part=callout-content],.dark .callout[data-callout-type=tip] [data-component-part=callout-icon] svg{color:#88bb8c!important}.callout[data-callout-type=warning]{background-color:rgba(203,134,6,.1)!important;border-color:rgba(203,134,6,.14)!important}.callout[data-callout-type=warning] [data-component-part=callout-content],.callout[data-callout-type=warning] [data-component-part=callout-icon] svg{color:#7b571e!important}.dark .callout[data-callout-type=warning]{background-color:rgba(203,134,6,.16)!important;border-color:rgba(203,134,6,.2)!important}.dark .callout[data-callout-type=warning] [data-component-part=callout-content],.dark .callout[data-callout-type=warning] [data-component-part=callout-icon] svg{color:#bca482!important}.callout[data-callout-type=check]{background-color:rgba(75,158,79,.1)!important;border-color:rgba(75,158,79,.14)!important}.callout[data-callout-type=check] [data-component-part=callout-content],.callout[data-callout-type=check] [data-component-part=callout-icon] svg{color:#136a22!important}.dark .callout[data-callout-type=check]{background-color:rgba(75,158,79,.18)!important;border-color:rgba(75,158,79,.22)!important}.dark .callout[data-callout-type=check] [data-component-part=callout-content],.dark .callout[data-callout-type=check] [data-component-part=callout-icon] svg{color:#88bb8c!important}.callout [data-component-part=callout-content] a{color:inherit!important;text-decoration:underline!important}#header .text-lg.prose p{font-family:\"GT Standard\",sans-serif!important;font-weight:300!important;font-size:18px!important;line-height:140%!important;letter-spacing:-.02em!important;color:#545658!important}.card{background-color:#f7f7f8!important}.dark .card{background-color:#121516!important}[data-component-part=card-content-container].flex{align-items:flex-start!important}[data-component-part=card-content]{font-family:\"GT Standard\",sans-serif!important;font-weight:300!important;font-size:14px!important;letter-spacing:-.02em!important;line-height:140%!important;color:#545658!important}.dark [data-component-part=card-content],.dark [data-component-part=step-content]>[data-as=p],.dark [data-component-part=step-content]>p{color:#abb0b3!important}#content-area.max-w-xl,#content-area[class*=\"--content-width\"]{max-width:56rem!important}hr{border:0!important;border-top:1px solid rgba(18,21,22,.2)!important;margin:56px 0!important}.dark hr{border-top:1px solid rgba(247,247,248,.2)!important}.steps{margin-left:18px!important}.step-container{padding-bottom:48px!important}.step-container:last-child{padding-bottom:0!important}[data-component-part=step-line]{width:1px!important;left:0!important;top:44px!important;height:calc(100% - 52px)!important;background:rgba(18,21,22,.1)!important;background-image:none!important}.dark [data-component-part=step-line]{background:rgba(247,247,248,.1)!important}[data-component-part=step-number]{margin-left:-18px!important;padding-top:0!important;padding-bottom:0!important}[data-component-part=step-number]>div:first-child{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;border-radius:50%!important;background-color:rgba(18,21,22,.06)!important;font-family:\"GT Standard\",sans-serif!important;font-weight:500!important;font-size:15px!important;line-height:17px!important;letter-spacing:-.02em!important;color:#121516!important}.dark [data-component-part=step-number]>div:first-child{background-color:rgba(247,247,248,.1)!important;color:#f7f7f8!important}.step-container>.w-full{padding-left:38px!important}[data-component-part=step-title]{font-family:\"GT Standard\",sans-serif!important;font-weight:500!important;font-size:17px!important;line-height:22px!important;letter-spacing:-.02em!important;color:#121516!important;margin-top:7px!important}.dark #section-menu-dropdown .toc-item a.border-primary,.dark #section-menu-dropdown .toc-item a.text-primary,.dark #section-menu-dropdown .toc-item a:hover,.dark #section-menu-dropdown .toc-item[data-depth=\"1\"] a.border-primary,.dark #section-menu-dropdown .toc-item[data-depth=\"1\"] a.text-primary,.dark #section-menu-dropdown .toc-item[data-depth=\"1\"] a:hover,.dark #section-menu-dropdown .toc-item[data-depth=\"2\"] a.border-primary,.dark #section-menu-dropdown .toc-item[data-depth=\"2\"] a.text-primary,.dark #section-menu-dropdown .toc-item[data-depth=\"2\"] a:hover,.dark .table td a:hover,.dark .toc-item a:hover,.dark .toc-item[data-depth=\"1\"] a:hover,.dark .toc-item[data-depth=\"2\"] a:hover,.dark [data-component-part=step-title]{color:#f7f7f8!important}[data-component-part=step-content]{margin-top:24px!important}[data-component-part=step-content]>[data-as=p],[data-component-part=step-content]>p{font-family:\"GT Standard\",sans-serif!important;font-weight:300!important;font-size:16px!important;line-height:140%!important;letter-spacing:-.02em!important;color:#545658!important}#table-of-contents>button{padding:0!important;margin-bottom:12px!important}#table-of-contents>button svg{width:24px!important;height:24px!important;stroke:rgba(18,21,22,.6)!important;stroke-width:1px!important}.dark #table-of-contents>button svg{stroke:rgba(247,247,248,.6)!important}#table-of-contents-content{border-left:1px solid rgba(18,21,22,.1)!important;padding-left:0!important;margin-left:0!important}.dark #table-of-contents-content{border-left-color:rgba(247,247,248,.1)!important}.toc-item{border-left:none!important;padding-left:0!important}#section-menu-dropdown .toc-item a,.toc-item a{font-family:\"GT Standard\",sans-serif!important;font-size:13px!important;font-weight:400!important;line-height:normal!important;letter-spacing:-.02em!important;color:rgba(18,21,22,.6)!important;display:block!important;text-decoration:none!important}.toc-item a{border-left:2px solid transparent!important;margin-left:-1px!important;padding:8px 0 8px 16px!important;transition:color .15s ease,border-color .15s ease!important}.toc-item a:hover{color:#121516!important}.dark .toc-item a{color:rgba(247,247,248,.6)!important}.toc-item a.border-primary,.toc-item a.text-primary,.toc-item a[data-active=true]{color:#121516!important;border-left-color:#121516!important;font-weight:400!important}.dark .toc-item a.border-primary,.dark .toc-item a.text-primary,.dark .toc-item a[data-active=true],.dark .toc-item[data-depth=\"1\"] a.border-primary,.dark .toc-item[data-depth=\"1\"] a.text-primary,.dark .toc-item[data-depth=\"1\"] a[data-active=true],.dark .toc-item[data-depth=\"2\"] a.border-primary,.dark .toc-item[data-depth=\"2\"] a.text-primary,.dark .toc-item[data-depth=\"2\"] a[data-active=true]{color:#f7f7f8!important;border-left-color:#f7f7f8!important}.toc-item[data-depth=\"1\"] a,.toc-item[data-depth=\"2\"] a{padding-left:36px!important;color:rgba(18,21,22,.5)!important}.toc-item[data-depth=\"2\"] a{padding-left:56px!important}.dark #section-menu-dropdown .toc-item[data-depth=\"1\"] a,.dark #section-menu-dropdown .toc-item[data-depth=\"2\"] a,.dark .toc-item[data-depth=\"1\"] a,.dark .toc-item[data-depth=\"2\"] a{color:rgba(247,247,248,.5)!important}.toc-item[data-depth=\"1\"] a:hover,.toc-item[data-depth=\"2\"] a:hover{color:#121516!important}.toc-item[data-depth=\"1\"] a.border-primary,.toc-item[data-depth=\"1\"] a.text-primary,.toc-item[data-depth=\"1\"] a[data-active=true],.toc-item[data-depth=\"2\"] a.border-primary,.toc-item[data-depth=\"2\"] a.text-primary,.toc-item[data-depth=\"2\"] a[data-active=true]{color:#121516!important;border-left-color:#121516!important}@media (max-width:1279px){#content-area{max-width:56rem!important}}#section-menu-btn{position:fixed;top:80px;right:24px;width:32px;height:32px;border-radius:6px;border:1px solid rgba(18,21,22,.4);background-color:#f7f7f8;display:none;align-items:center;justify-content:center;cursor:pointer;z-index:50;transition:background-color .15s ease,border-color .15s ease;padding:0}#section-menu-btn.open,#section-menu-btn:hover{background-color:#fcfcfc;border-color:rgba(18,21,22,.6)}#section-menu-btn svg{width:24px;height:24px;stroke:#121516;stroke-width:1px}.dark #section-menu-btn{background-color:#121516;border-color:rgba(247,247,248,.4)}.dark #section-menu-btn.open,.dark #section-menu-btn:hover{background-color:#1d2022}.dark #section-menu-btn svg{stroke:#f7f7f8}#section-menu-backdrop{position:fixed;inset:0;z-index:51;display:none}#section-menu-backdrop.open{display:block}#section-menu-dropdown{position:fixed;top:120px;right:24px;background-color:#f7f7f8;padding:25px;border:1px solid rgba(18,21,22,.2);border-radius:8px;box-shadow:0 4px 10px rgba(0,0,0,.1);z-index:52;width:229px;max-height:60vh;overflow-y:auto;transform-origin:top right;opacity:0;transform:scale(.95);pointer-events:none;transition:opacity .15s ease,transform .15s ease}#section-menu-dropdown.open{opacity:1;transform:scale(1);pointer-events:auto}.dark #section-menu-dropdown{background-color:#121516;border-color:rgba(247,247,248,.2);box-shadow:none}#section-menu-dropdown ul{list-style:none;margin:0;padding:0}#section-menu-dropdown .toc-item{border-left:none!important;padding-left:0!important}#section-menu-dropdown .toc-item a{border-left:none!important;border-radius:0!important;background:0 0!important;padding:0!important;margin-bottom:15px!important;transition:color .15s ease!important}#section-menu-dropdown .toc-item a:hover{color:#121516!important;background:0 0!important}#section-menu-dropdown .toc-item a.border-primary,#section-menu-dropdown .toc-item a.text-primary,#section-menu-dropdown .toc-item[data-depth=\"1\"] a.border-primary,#section-menu-dropdown .toc-item[data-depth=\"1\"] a.text-primary,#section-menu-dropdown .toc-item[data-depth=\"1\"] a:hover,#section-menu-dropdown .toc-item[data-depth=\"2\"] a.border-primary,#section-menu-dropdown .toc-item[data-depth=\"2\"] a.text-primary,#section-menu-dropdown .toc-item[data-depth=\"2\"] a:hover,.sidebar-group a.bg-primary\\/10 svg,.sidebar-group a:hover svg,.sidebar-group a[aria-current=page] svg,.sidebar-group button[aria-expanded]:hover svg,.table td a:hover{color:#121516!important}.dark #section-menu-dropdown .toc-item a,.dark .sidebar-group svg,.dark .table td a{color:rgba(247,247,248,.6)!important}#section-menu-dropdown .toc-item[data-depth=\"1\"] a{padding-left:20px!important;color:rgba(18,21,22,.5)!important}#section-menu-dropdown .toc-item[data-depth=\"2\"] a{padding-left:40px!important;color:rgba(18,21,22,.5)!important}@media (min-width:1280px){#section-menu-backdrop,#section-menu-btn,#section-menu-dropdown{display:none!important}}[data-table-wrapper=true]{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important}[data-table-wrapper=true]::-webkit-scrollbar{height:8px;-webkit-appearance:none}[data-table-wrapper=true]::-webkit-scrollbar-track{background:0 0}[data-table-wrapper=true]::-webkit-scrollbar-thumb{background-color:rgba(18,21,22,.35);border-radius:4px}[data-table-wrapper=true]:hover::-webkit-scrollbar-thumb{background-color:rgba(18,21,22,.55)}.dark [data-table-wrapper=true]::-webkit-scrollbar-thumb{background-color:rgba(247,247,248,.35)}.dark [data-table-wrapper=true]:hover::-webkit-scrollbar-thumb{background-color:rgba(247,247,248,.55)}@supports not (selector(::-webkit-scrollbar)){[data-table-wrapper=true]{scrollbar-width:thin;scrollbar-color:rgba(18,21,22,.35) transparent}.dark [data-table-wrapper=true]{scrollbar-color:rgba(247,247,248,.35) transparent}}.table{border-collapse:collapse!important;border-spacing:0!important}.table td,.table th{font-family:\"GT Standard\",sans-serif!important;font-size:13px!important;letter-spacing:-.02em!important;padding:16px 16px 16px 0!important;border-top:none!important;border-left:none!important;border-right:none!important;background-color:transparent!important}.table th{font-weight:400!important;color:#121516!important;border-bottom:1px solid rgba(18,21,22,.3)!important;white-space:nowrap}.table td{font-weight:300!important;color:#545658!important;border-bottom:1px solid rgba(18,21,22,.1)!important}.table tbody tr:last-child td{border-bottom:none!important}.dark .table th{color:#f7f7f8!important;border-bottom-color:rgba(247,247,248,.3)!important}.dark .table td{color:#abb0b3!important;border-bottom-color:rgba(247,247,248,.1)!important}.table td strong{color:inherit!important}.table td code{font-size:13px!important;padding:2px 6px!important}.table td:first-child code{white-space:nowrap}.table td:nth-child(2){white-space:normal;word-break:break-word}.sidebar-group svg,.table td a{color:rgba(18,21,22,.6)!important}.table td a{text-decoration:underline!important;text-decoration-thickness:1px!important;text-underline-offset:2px!important;transition:color .2s ease}.sidebar-group a,.sidebar-group button[aria-expanded],.sidebar-group-header{font-size:13px!important;font-family:\"GT Standard\",sans-serif!important;letter-spacing:-.02em!important;color:#121516!important}.sidebar-group-header{font-weight:600!important;text-transform:none!important}.dark .sidebar-group a,.dark .sidebar-group a.bg-primary\\/10 svg,.dark .sidebar-group a:hover svg,.dark .sidebar-group a[aria-current=page] svg,.dark .sidebar-group button[aria-expanded],.dark .sidebar-group button[aria-expanded]:hover svg,.dark .sidebar-group-header{color:#f7f7f8!important}.sidebar-group a,.sidebar-group button[aria-expanded]{font-weight:400!important;line-height:140%!important;text-decoration:none!important;transition:background-color .15s ease,color .15s ease!important}.sidebar-group a.bg-primary\\/10,.sidebar-group a:hover,.sidebar-group a[aria-current=page],.sidebar-group button[aria-expanded]:hover{background:rgba(18,21,22,.06)!important;color:#121516!important;border-radius:8px!important}.dark .sidebar-group a.bg-primary\\/10,.dark .sidebar-group a:hover,.dark .sidebar-group a[aria-current=page],.dark .sidebar-group button[aria-expanded]:hover{background:rgba(247,247,248,.14)!important;color:#f7f7f8!important}.sidebar-group svg{width:16px!important;height:16px!important;stroke-width:1px!important}@media (min-width:1024px){#content-container:has(>.flex.flex-row-reverse>:is(#content-area.max-w-xl, #content-area[class*=\"--content-width\"])){padding-left:3rem!important;padding-right:1.5rem!important}#content-container>.flex.flex-row-reverse:has(>:is(#content-area.max-w-xl, #content-area[class*=\"--content-width\"])){padding-left:0!important;column-gap:1.5rem!important}#content-container>.flex.flex-row-reverse>#content-side-layout>#table-of-contents-layout{width:15rem!important;padding-left:1rem!important}#content-container>.flex.flex-row-reverse>#content-side-layout>#table-of-contents-layout #table-of-contents{width:14rem!important}#content-container>.flex.flex-row-reverse>:is(#content-area.max-w-xl, #content-area[class*=\"--content-width\"]){max-width:64rem!important}}"}],"page":{"pagePath":"docs/cookbook/index","slug":"/docs/cookbook/index","pageMetadata":{"slug":"/","title":"Cookbook","sidebarTitle":"Perplexity API Cookbook","description":"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.","keywords":["perplexity","api","cookbook","recipes","examples","agent-api","search-api","embeddings"],"href":"/docs/cookbook/index"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const CookbookGallery=()=>{const _components={a:`a`,..._provideComponents()};const[{recipes,facets,labels}]=useState(()=>({\"recipes\":[{\"title\":`Track What the Web Said Each Week About a Topic, and Build a Report`,\"description\":`Search engines tell you what the web says today. This recipe shows what was being reported about a topic during each week of a date range: the Agent API searches each week with publication-date filters, explains how the story changed, and counts the outlets that covered it, while your code writes the timeline and draws the chart.`,\"href\":`/docs/cookbook/examples/agent-api-story-timeline/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`search-filtering`,`streaming`,`orchestration`,`sandbox`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-26T20:05:00Z`},{\"title\":`Catch Visual Bugs in CI with the Decisions API`,\"description\":`Use Playwright screenshots and Decisions API probabilities to check selected pages for visual defects. Your code applies cutoffs, reports warnings, and fails CI when a failure rule fires.`,\"href\":`/docs/cookbook/examples/decisions-api-visual-qa-gate/README`,\"type\":`example`,\"products\":[`decisions-api`],\"categories\":[`multimodal`,`orchestration`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-21T17:15:51Z`},{\"title\":`Enrich a CSV of Companies Overnight with the Batch API`,\"description\":`Write one web-grounded Agent API request per CSV row to a JSONL file, run them asynchronously with the Batch API, and join the output back to your rows by custom_id.`,\"href\":`/docs/cookbook/examples/batch-api-company-enrichment/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`structured-outputs`,`orchestration`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-21T17:09:05Z`},{\"title\":`Check a Chart for Misleading Design with a Decision Model`,\"description\":`Send a chart image to the Decisions API with yes/no questions about misleading design and your brand guide, and get a probability for each. Your code gates the checks by chart type, compares them to cutoffs, labels the chart, and prints why.`,\"href\":`/docs/cookbook/examples/decisions-api-chart-check/README`,\"type\":`example`,\"products\":[`decisions-api`],\"categories\":[`multimodal`,`structured-outputs`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-19T20:27:16Z`},{\"title\":`Rank Search Results to Answer Questions with the Best Quote Using Decisions API`,\"description\":`Use Decisions API probabilities to rank sentences from your Search API results, then return the quote that best answers the question, with its URL.`,\"href\":`/docs/cookbook/examples/decisions-quote-finder/README`,\"type\":`example`,\"products\":[`decisions-api`,`search-api`],\"categories\":[`orchestration`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-09T22:28:15Z`},{\"title\":`Check Agent Actions Before They Run with Decisions API`,\"description\":`Run an accounts-payable agent that can pay vendors, but checks proposed functions before they run using Decisions API. The Decisions API provides probabilities for questions about whether the proposed function should run, and your code compares those probabilities to cutoffs to allow, ask about, or block the call before your agent takes action.`,\"href\":`/docs/cookbook/examples/decisions-api-action-gate/README`,\"type\":`example`,\"products\":[`decisions-api`,`agent-api`],\"categories\":[`orchestration`,`function-calling`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-09T01:19:52Z`},{\"title\":`Judge Citation Accuracy with Decisions API`,\"description\":`Ask the Agent API a question with web search, score every sentence against its sources with the Decisions API, and send low-scoring sentences back to the Agent API to search again. Your code keeps only the rewrites the sources support.`,\"href\":`/docs/cookbook/examples/decisions-api-answer-gate/README`,\"type\":`example`,\"products\":[`decisions-api`,`agent-api`],\"categories\":[`orchestration`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-07T23:05:35Z`},{\"title\":`Drive a Browser with the Decisions API`,\"description\":`Build a browser agent that asks the Decisions API six questions about a numbered screenshot and gets probabilities back. Your code compares them to cutoffs and does the clicking, scrolling, and stopping. One Decisions API request per step, plus retries if needed.`,\"href\":`/docs/cookbook/examples/decisions-api-browser-agent/README`,\"type\":`example`,\"products\":[`decisions-api`],\"categories\":[`multimodal`,`orchestration`],\"date\":`Oct 2026`,\"dateSort\":`2026-10-06T20:49:55Z`},{\"title\":`Triage Support Tickets with the Decisions API`,\"description\":`Route inbound support tickets with three probabilistic questions per ticket from the Decisions API, then send only the escalations to the Agent API.`,\"href\":`/docs/cookbook/examples/decisions-api-ticket-triage/README`,\"type\":`example`,\"products\":[`decisions-api`],\"categories\":[`orchestration`,`structured-outputs`],\"date\":`Sep 2026`,\"dateSort\":`2026-09-30T20:31:34Z`},{\"title\":`Build a Data Analytics Agent Using Custom Connectors`,\"description\":`Ask your agent why conversions fell, have it inspect the data, and turn the investigation into a chart for you to review.`,\"href\":`/docs/cookbook/examples/agent-api-data-analyst/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`mcp`,`integrations`,`orchestration`],\"date\":`Sep 2026`,\"dateSort\":`2026-09-22T18:21:33Z`},{\"title\":`Turn Agent Failures into Regression Tests`,\"description\":`Build a web-grounded API troubleshooting advisor, then catch unsafe retry advice and unsupported answers before switching models.`,\"href\":`/docs/cookbook/examples/agent-api-regression-testing/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`orchestration`,`structured-outputs`],\"date\":`Sep 2026`,\"dateSort\":`2026-09-21T17:30:57Z`},{\"title\":`Search as Code for coding agents`,\"description\":`Use the Perplexity Search SDK to build a source-backed dependency migration packet that any coding agent can inspect before it edits code.`,\"href\":`/docs/cookbook/articles/search-as-code-coding-agents/README`,\"type\":`guide`,\"products\":[`search-api`],\"categories\":[`search-filtering`,`orchestration`],\"date\":`Sep 2026`,\"dateSort\":`2026-09-15T22:19:29Z`},{\"title\":`Build an incident responder with Profiles, Skills, and Managed Connectors`,\"description\":`Combine a saved Profile, an Incident Response Skill, Sandbox, and Datadog, GitHub, and Slack managed connectors, then launch the custom agent with the Agent API.`,\"href\":`/docs/cookbook/articles/incident-responder/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`orchestration`,`integrations`],\"date\":`Sep 2026`,\"dateSort\":`2026-09-09T20:56:05Z`},{\"title\":`Enrich Customer Data with Agent API`,\"description\":`Use Agent API with people_search to enrich a ClickHouse customer data row and append the result to the table.`,\"href\":`/docs/cookbook/examples/customer-enrichment-agent-api/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`people`,`function-calling`],\"date\":`Sep 2026`,\"dateSort\":`2026-09-01T22:43:29Z`},{\"title\":`GitHub investigation agent using managed connectors`,\"description\":`Use managed Slack and GitHub connectors to investigate a linked bug report and reply in its Slack thread.`,\"href\":`/docs/cookbook/examples/triage-bug-report-connectors/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`sandbox`,`orchestration`,`integrations`],\"date\":`Aug 2026`,\"dateSort\":`2026-08-28T00:59:07Z`},{\"title\":`Customizing Effort Levels`,\"description\":``,\"href\":`/docs/cookbook/examples/agent-api-effort/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[],\"date\":`Aug 2026`,\"dateSort\":`2026-08-19T23:47:06Z`},{\"title\":`Grounded Data Story with Kimi K3`,\"description\":`Turn any topic into a self-contained, source-linked interactive HTML report using Kimi K3, live web search, and the Agent API.`,\"href\":`/docs/cookbook/examples/data-story-kimi-k3/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`deep-research`,`orchestration`],\"date\":`Aug 2026`,\"dateSort\":`2026-08-07T17:56:38Z`},{\"title\":`Daily News Digest with LLM Deduplication`,\"description\":`Build a daily news digest that reports each story once. One Agent API request runs code in the sandbox to fetch the day's news, groups coverage into stories, and delivers the digest and a story registry as files.`,\"href\":`/docs/cookbook/articles/news-dedupe-digest/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`sandbox`,`orchestration`],\"date\":`Jul 2026`,\"dateSort\":`2026-07-21T04:01:18Z`},{\"title\":`Daily AI Stock News PDF with Skills`,\"description\":`Generate a daily one-page AI-industry stock news PDF with the Agent API using the built-in office skill and an inline design skill.`,\"href\":`/docs/cookbook/articles/agent-skills/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`sandbox`,`orchestration`],\"date\":`Jul 2026`,\"dateSort\":`2026-07-17T12:40:41Z`},{\"title\":`Model Picker`,\"description\":`Describe a task and get a grounded shortlist of open models to use. One Agent API request combines the Hugging Face MCP server with web search to find, verify, and recommend a model.`,\"href\":`/docs/cookbook/examples/model-picker/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`mcp`,`integrations`],\"date\":`Jul 2026`,\"dateSort\":`2026-07-05T14:24:31Z`},{\"title\":`Talent Sourcer`,\"description\":`Build a vetted engineer sourcing shortlist with one Agent API request. The model works in a Python sandbox - segmenting the brief, calling people_search across sub-segments, verifying each candidate's role, location, and tenure with web_search, collecting GitHub, social, and publication links, scoring and de-duplicating in code, then rendering an HTML shortlist and sharing it with share_file.`,\"href\":`/docs/cookbook/examples/talent-sourcer/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`people`,`sandbox`],\"date\":`Jun 2026`,\"dateSort\":`2026-06-19T22:18:16Z`},{\"title\":`Competitor Buzz Tracker`,\"description\":`Turn a basket of searches and keyword rules into a one-page share-of-voice chart (PDF) with two chained Agent API requests. The first searches and counts inside the sandbox and returns a structured-output JSON contract. The second renders the bar chart and shares it as a downloadable file.`,\"href\":`/docs/cookbook/examples/competitor-buzz-tracker/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`sandbox`,`structured-outputs`],\"date\":`Jun 2026`,\"dateSort\":`2026-06-18T19:16:39Z`},{\"title\":`VC Investment Memo Agent with LangGraph`,\"description\":`Build an auditable, citation-grounded VC research agent with LangGraph and the Perplexity Agent API, and pick the best search provider with a LangSmith eval harness.`,\"href\":`/docs/cookbook/articles/langchain-vc-memo-agent/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`finance`,`deep-research`,`orchestration`,`integrations`],\"date\":`Jun 2026`,\"dateSort\":`2026-06-11T19:27:53Z`},{\"title\":`Multi-Provider Orchestration`,\"description\":`Route between OpenAI, Anthropic, Google, and xAI models through Perplexity's Agent API with transparent pricing, build fallback chains, and compare providers side-by-side`,\"href\":`/docs/cookbook/articles/multi-provider-orchestration/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`function-calling`,`orchestration`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:46:59Z`},{\"title\":`Function Calling End-to-End`,\"description\":`Complete multi-turn function calling patterns for the Perplexity Agent API, including orchestration, web search integration, error handling, and parallel calls`,\"href\":`/docs/cookbook/articles/function-calling-e2e/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`function-calling`,`orchestration`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:45:38Z`},{\"title\":`RAG with Perplexity Embeddings`,\"description\":`Build an end-to-end retrieval-augmented generation pipeline using Perplexity's standard and contextualized embedding models.`,\"href\":`/docs/cookbook/articles/embeddings-rag/README`,\"type\":`guide`,\"products\":[`agent-api`,`embeddings-api`],\"categories\":[`rag`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:44:55Z`},{\"title\":`Structured Output Extraction`,\"description\":`Get typed, schema-validated JSON responses from the Agent API using response_format with JSON schemas for data extraction, pipelines, and structured research`,\"href\":`/docs/cookbook/articles/structured-output-extraction/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`structured-outputs`,`function-calling`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:44:55Z`},{\"title\":`Academic and Scholarly Search`,\"description\":`Use the Agent API's domain filtering to restrict search to academic sources, extract DOIs and paper metadata, build citation chains, and create research summaries with proper attribution`,\"href\":`/docs/cookbook/articles/academic-search/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`structured-outputs`,`search-filtering`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:42:27Z`},{\"title\":`Search Domain Filtering Patterns`,\"description\":`Use search_domain_filter for focused search — allowlist patterns for trusted sources, denylist for excluding domains, and practical patterns for news, government, and competitive intelligence`,\"href\":`/docs/cookbook/articles/search-domain-filtering/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`search-filtering`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:42:27Z`},{\"title\":`Streaming Citation Parsing`,\"description\":`Consume streaming responses from the Agent API and extract, validate, and display citations in real-time as chunks arrive`,\"href\":`/docs/cookbook/articles/streaming-citations/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`streaming`,`integrations`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:42:27Z`},{\"title\":`TypeScript Agent CLI`,\"description\":`An interactive TypeScript CLI with streaming responses, model selection, and web search using the Perplexity Agent API`,\"href\":`/docs/cookbook/examples/typescript-agent-cli/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`streaming`,`memory`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:42:27Z`},{\"title\":`Agent Research Assistant`,\"description\":`A CLI tool that uses Perplexity's Agent API with the medium effort level to conduct multi-step web research and produce structured reports`,\"href\":`/docs/cookbook/examples/agent-research-assistant/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`deep-research`,`structured-outputs`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:24:39Z`},{\"title\":`Multi-Provider Model Comparison`,\"description\":`A CLI tool that sends the same prompt to multiple AI models via Perplexity's Agent API and compares response quality, latency, and cost`,\"href\":`/docs/cookbook/examples/model-comparison/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`orchestration`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:24:39Z`},{\"title\":`Search News Monitor`,\"description\":`A CLI tool that uses Perplexity's Search API to monitor real-time news across multiple configurable topics with domain and recency filtering`,\"href\":`/docs/cookbook/examples/search-news-monitor/README`,\"type\":`example`,\"products\":[`search-api`],\"categories\":[`search-filtering`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:24:39Z`},{\"title\":`Document Q\u0026A`,\"description\":`Load documents and ask questions about them via the Agent API — text extraction, web search enrichment, multi-turn Q\u0026A, and structured output extraction`,\"href\":`/docs/cookbook/examples/file-attachment-qa/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`structured-outputs`,`function-calling`,`memory`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:18:41Z`},{\"title\":`Document Q\u0026A with Embeddings`,\"description\":`A self-contained RAG system that ingests documents, generates contextualized embeddings, and answers questions using the Agent API`,\"href\":`/docs/cookbook/examples/document-qa/README`,\"type\":`example`,\"products\":[`agent-api`,`embeddings-api`],\"categories\":[`rag`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:18:41Z`},{\"title\":`Image Analysis`,\"description\":`Vision-powered image analysis with web search for context-enriched results using the Perplexity Agent API`,\"href\":`/docs/cookbook/examples/image-analysis/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`multimodal`,`function-calling`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:18:41Z`},{\"title\":`SEC Filing Search`,\"description\":`Use search domain filtering to query SEC.gov and EDGAR for financial filings, extract key financial data, and build structured financial summaries`,\"href\":`/docs/cookbook/examples/sec-filing-search/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`finance`,`structured-outputs`,`search-filtering`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T22:18:41Z`},{\"title\":`Deep Research Workflows`,\"description\":`Use the Agent API medium effort level for comprehensive, multi-step research tasks — synchronous usage, batch concurrency, result processing, and production patterns`,\"href\":`/docs/cookbook/articles/async-deep-research/README`,\"type\":`guide`,\"products\":[`agent-api`],\"categories\":[`deep-research`,`search-filtering`],\"date\":`May 2026`,\"dateSort\":`2026-05-15T21:22:03Z`},{\"title\":`Equity Research Brief`,\"description\":`Generate institutional-grade equity research briefs from any public ticker using the Perplexity Agent API and the built-in finance_search tool.`,\"href\":`/docs/cookbook/examples/equity-research-brief/README`,\"type\":`example`,\"products\":[`agent-api`],\"categories\":[`finance`,`function-calling`],\"date\":`May 2026`,\"dateSort\":`2026-05-07T12:20:38Z`}],\"facets\":{\"products\":[`agent-api`,`search-api`,`embeddings-api`,`decisions-api`],\"categories\":[`finance`,`people`,`sandbox`,`multimodal`,`rag`,`deep-research`,`structured-outputs`,`function-calling`,`streaming`,`memory`,`search-filtering`,`orchestration`,`integrations`,`mcp`],\"type\":[`guide`,`example`]},\"labels\":{\"products\":{\"agent-api\":`Agent API`,\"search-api\":`Search API`,\"embeddings-api\":`Embeddings API`,\"decisions-api\":`Decisions API`},\"categories\":{\"finance\":`Finance`,\"people\":`People`,\"sandbox\":`Sandbox`,\"multimodal\":`Multimodal`,\"rag\":`RAG`,\"deep-research\":`Deep Research`,\"structured-outputs\":`Structured Outputs`,\"function-calling\":`Function Calling`,\"streaming\":`Streaming`,\"memory\":`Memory`,\"search-filtering\":`Search Filtering`,\"orchestration\":`Orchestration`,\"integrations\":`Integrations`,\"mcp\":`MCP`},\"type\":{\"guide\":`Guide`,\"example\":`Example`,\"showcase\":`Showcase`}}}));const label=value=>labels.products\u0026\u0026labels.products[value]||labels.categories\u0026\u0026labels.categories[value]||labels.type\u0026\u0026labels.type[value]||value;const pillStyle=(facet,value)=>{const k=facet===`products`?value:facet===`type`?`type`:`category`;return{color:`var(--cb-${k}-fg)`,backgroundColor:`var(--cb-${k}-bg)`}};const renderPill=(facet,value,key)=>_jsx(`span`,{className:`mint-inline-flex mint-items-center mint-rounded-full mint-px-2.5 mint-py-0.5 mint-text-xs mint-font-medium mint-whitespace-nowrap`,style:pillStyle(facet,value),children:label(value)},key);const products=facets.products||[];const flatOptions=[...products,...facets.categories||[],...facets.type||[]];const CHIP_EXCLUDE=new Set([`sonar-api`]);const chipProducts=products.filter(p=>!CHIP_EXCLUDE.has(p));const CAT_PARAM=`category`;const SEARCH_PARAM=`q`;const[searchText,setSearchText]=useState(``);const[selected,setSelected]=useState(()=>new Set);const[dropdownOpen,setDropdownOpen]=useState(false);const dropdownRef=useRef(null);useEffect(()=>{if(typeof window===`undefined`)return;const params=new URLSearchParams(window.location.search);const q=params.get(SEARCH_PARAM);if(q)setSearchText(q);const valid=new Set(flatOptions);const fromUrl=params.getAll(CAT_PARAM).filter(v=>valid.has(v));if(fromUrl.length)setSelected(new Set(fromUrl))},[]);useEffect(()=>{if(typeof window===`undefined`)return;const params=new URLSearchParams(window.location.search);params.delete(SEARCH_PARAM);params.delete(CAT_PARAM);const q=searchText.trim();if(q)params.set(SEARCH_PARAM,q);[...selected].forEach(v=>params.append(CAT_PARAM,v));const qs=params.toString();window.history.replaceState(null,``,qs?`?${qs}`:window.location.pathname)},[selected,searchText]);useEffect(()=>{if(!dropdownOpen)return undefined;const onClick=e=>{if(dropdownRef.current\u0026\u0026!dropdownRef.current.contains(e.target))setDropdownOpen(false)};const onKey=e=>{if(e.key===`Escape`)setDropdownOpen(false)};document.addEventListener(`mousedown`,onClick);document.addEventListener(`keydown`,onKey);return()=>{document.removeEventListener(`mousedown`,onClick);document.removeEventListener(`keydown`,onKey)}},[dropdownOpen]);const toggle=value=>{setSelected(prev=>{const next=new Set(prev);if(next.has(value))next.delete(value);else next.add(value);return next})};const query=searchText.trim().toLowerCase();const filtered=recipes.filter(r=>{if(query){const hay=[r.title,r.description,...(r.products||[]).map(label),...(r.categories||[]).map(label),r.type?label(r.type):``].join(` `).toLowerCase();if(!hay.includes(query))return false}if(selected.size>0){const tags=[...r.products||[],...r.categories||[],r.type].filter(Boolean);if(!tags.some(t=>selected.has(t)))return false}return true});const clearAll=()=>setSelected(new Set);const checkIcon=_jsx(`svg`,{className:`mint-w-3 mint-h-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,\"aria-hidden\":`true`,children:_jsx(`polyline`,{points:`20 6 9 17 4 12`})});return _jsxs(`div`,{className:`not-prose mint-w-full`,style:{boxSizing:`border-box`},children:[_jsxs(`div`,{className:`mint-flex mint-flex-col mint-gap-4 mint-max-w-3xl mint-mx-auto`,children:[_jsxs(`div`,{className:`mint-flex mint-flex-col sm:mint-flex-row mint-gap-3 mint-order-2 sm:mint-order-1`,children:[_jsxs(`div`,{className:`mint-relative mint-flex-1`,children:[_jsxs(`svg`,{className:`mint-absolute mint-left-4 mint-top-1/2 mint-h-4 mint-w-4 text-muted-foreground mint-pointer-events-none`,style:{transform:`translateY(-50%)`},viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,\"aria-hidden\":`true`,children:[_jsx(`circle`,{cx:`11`,cy:`11`,r:`7`}),_jsx(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),_jsx(`input`,{type:`text`,value:searchText,onChange:e=>setSearchText(e.target.value),placeholder:`Search recipes…`,\"aria-label\":`Search recipes`,className:`mint-w-full mint-rounded-full mint-border mint-pl-11 mint-pr-10 mint-py-2.5 mint-text-sm mint-bg-transparent text-foreground placeholder:text-muted-foreground focus:mint-outline-none focus:mint-ring-2`,style:{borderColor:`var(--color-border)`}}),searchText\u0026\u0026_jsx(`button`,{type:`button`,onClick:()=>setSearchText(``),\"aria-label\":`Clear search`,className:`mint-absolute mint-right-3 mint-top-1/2 mint-flex mint-h-5 mint-w-5 mint-items-center mint-justify-center mint-rounded-full text-muted-foreground hover:text-foreground hover:mint-bg-[var(--cb-hover)] mint-transition-colors`,style:{transform:`translateY(-50%)`},children:_jsxs(`svg`,{className:`mint-h-3.5 mint-w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,\"aria-hidden\":`true`,children:[_jsx(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_jsx(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),_jsxs(`div`,{className:`mint-relative`,ref:dropdownRef,children:[_jsxs(`button`,{type:`button`,onClick:()=>setDropdownOpen(v=>!v),\"aria-expanded\":dropdownOpen,\"aria-haspopup\":`true`,className:`mint-inline-flex mint-items-center mint-gap-2 mint-rounded-full mint-border mint-px-4 mint-py-2.5 mint-text-sm mint-font-medium text-foreground hover:mint-bg-[var(--color-card)] mint-transition-colors mint-whitespace-nowrap`,style:{borderColor:`var(--color-border)`},children:[_jsxs(`svg`,{className:`mint-h-4 mint-w-4`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,\"aria-hidden\":`true`,children:[_jsx(`line`,{x1:`4`,y1:`6`,x2:`20`,y2:`6`}),_jsx(`line`,{x1:`7`,y1:`12`,x2:`17`,y2:`12`}),_jsx(`line`,{x1:`10`,y1:`18`,x2:`14`,y2:`18`})]}),selected.size>0?`${selected.size} ${selected.size===1?`Category`:`Categories`}`:`Categories`,_jsx(`svg`,{className:`mint-h-3.5 mint-w-3.5 mint-opacity-70`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,\"aria-hidden\":`true`,children:_jsx(`polyline`,{points:`6 9 12 15 18 9`})})]}),dropdownOpen\u0026\u0026_jsxs(`div`,{className:`mint-absolute mint-right-0 mint-z-50 mint-mt-2 mint-w-64 mint-max-h-[400px] mint-overflow-y-auto mint-rounded-lg mint-border mint-p-2 mint-shadow-lg`,style:{backgroundColor:`var(--cb-popover-bg)`,borderColor:`var(--cb-popover-border)`},role:`dialog`,\"aria-label\":`Filter by category`,children:[_jsxs(`div`,{className:`mint-flex mint-justify-between mint-items-center mint-mb-2 mint-px-2 mint-pb-2 mint-border-b`,style:{borderColor:`var(--cb-popover-border)`},children:[_jsx(`span`,{className:`mint-text-sm mint-font-medium text-foreground`,children:`Categories`}),selected.size>0\u0026\u0026_jsx(`button`,{type:`button`,onClick:clearAll,className:`mint-text-xs mint-font-medium`,style:{color:`var(--cb-accent-fg)`},children:`Clear all`})]}),_jsx(`div`,{className:`mint-space-y-0.5`,children:flatOptions.map(value=>{const checked=selected.has(value);return _jsxs(`label`,{className:`mint-flex mint-items-center mint-gap-2.5 mint-px-2 mint-py-1.5 mint-rounded mint-cursor-pointer hover:mint-bg-[var(--color-card)]`,children:[_jsx(`input`,{type:`checkbox`,className:`mint-sr-only`,checked,onChange:()=>toggle(value)}),_jsx(`span`,{className:`mint-shrink-0 mint-w-4 mint-h-4 mint-flex mint-items-center mint-justify-center mint-border mint-rounded mint-transition-colors`,style:checked?{backgroundColor:`var(--cb-accent-fg)`,borderColor:`var(--cb-accent-fg)`,color:`var(--cb-popover-bg)`}:{backgroundColor:`transparent`,borderColor:`var(--color-border)`},children:checked\u0026\u0026checkIcon}),_jsx(`span`,{className:`mint-text-sm text-foreground`,children:label(value)})]},value)})})]})]})]}),!query\u0026\u0026_jsx(`div`,{className:`mint-flex mint-flex-wrap mint-justify-center mint-gap-2 mint-order-1 sm:mint-order-2`,children:chipProducts.map(p=>_jsx(`button`,{type:`button`,onClick:()=>setSearchText(label(p)),className:`cb-chip mint-inline-flex mint-items-center mint-rounded-full mint-border mint-px-3.5 mint-py-1.5 mint-text-sm mint-font-medium text-foreground mint-transition-colors`,style:{borderColor:`var(--color-border)`},children:label(p)},p))})]}),_jsxs(`div`,{className:`mint-max-w-3xl mint-mx-auto mint-mt-8 mint-mb-3 mint-px-1 mint-text-sm text-muted-foreground`,\"aria-live\":`polite`,children:[filtered.length,` `,filtered.length===1?`recipe`:`recipes`]}),_jsx(`div`,{className:`mint-max-w-3xl mint-mx-auto`,children:filtered.length===0?_jsx(`div`,{className:`mint-text-center mint-py-16 text-muted-foreground`,children:`No recipes match your filters.`}):_jsx(`ul`,{className:`mint-flex mint-flex-col mint-divide-y`,style:{borderColor:`var(--color-border)`},children:filtered.map(r=>_jsx(`li`,{children:_jsxs(_components.a,{href:r.href,className:`mint-group cookbook-card mint-flex mint-flex-col mint-gap-2 mint-py-5 mint-px-1 mint-transition-colors hover:mint-bg-[var(--color-card)] mint-rounded-lg sm:mint-px-3 mint--mx-1 sm:mint--mx-3`,children:[_jsxs(`div`,{className:`mint-flex mint-items-baseline mint-justify-between mint-gap-4`,children:[_jsx(`h3`,{className:`mint-text-base mint-font-semibold text-foreground group-hover:mint-underline`,children:r.title}),r.date\u0026\u0026_jsx(`span`,{className:`mint-shrink-0 mint-text-xs text-muted-foreground mint-whitespace-nowrap mint-tabular-nums`,children:r.date})]}),r.description\u0026\u0026_jsx(`p`,{className:`mint-text-sm text-muted-foreground mint-line-clamp-2`,children:r.description}),_jsxs(`div`,{className:`mint-flex mint-flex-wrap mint-gap-1.5 mint-pt-0.5`,children:[(r.products||[]).map(v=>renderPill(`products`,v,`p-${v}`)),(r.categories||[]).map(v=>renderPill(`categories`,v,`c-${v}`)),r.type\u0026\u0026renderPill(`type`,r.type,`ty-${r.type}`)]})]})},r.href))})})]})};function _createMdxContent(props){const _components={a:`a`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Visibility,_MdxComponentBoundary}=_components;if(!Visibility)_missingMdxReference(`Visibility`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(Visibility,{for:`humans`,children:_jsx(_MdxComponentBoundary,{name:`CookbookGallery`,children:_jsx(CookbookGallery,{})})}),`\n`,_jsxs(Visibility,{for:`agents`,children:[_jsx(_components.p,{children:`All cookbook recipes, newest first:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/agent-api-story-timeline/README`,children:`Track What the Web Said Each Week About a Topic, and Build a Report`}),`: Search engines tell you what the web says today. This recipe shows what was being reported about a topic during each week of a date range: the Agent API searches each week with publication-date filters, explains how the story changed, and counts the outlets that covered it, while your code writes the timeline and draws the chart.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-api-visual-qa-gate/README`,children:`Catch Visual Bugs in CI with the Decisions API`}),`: Use Playwright screenshots and Decisions API probabilities to check selected pages for visual defects. Your code applies cutoffs, reports warnings, and fails CI when a failure rule fires.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/batch-api-company-enrichment/README`,children:`Enrich a CSV of Companies Overnight with the Batch API`}),`: Write one web-grounded Agent API request per CSV row to a JSONL file, run them asynchronously with the Batch API, and join the output back to your rows by custom_id.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-api-chart-check/README`,children:`Check a Chart for Misleading Design with a Decision Model`}),`: Send a chart image to the Decisions API with yes/no questions about misleading design and your brand guide, and get a probability for each. Your code gates the checks by chart type, compares them to cutoffs, labels the chart, and prints why.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-quote-finder/README`,children:`Rank Search Results to Answer Questions with the Best Quote Using Decisions API`}),`: Use Decisions API probabilities to rank sentences from your Search API results, then return the quote that best answers the question, with its URL.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-api-action-gate/README`,children:`Check Agent Actions Before They Run with Decisions API`}),`: Run an accounts-payable agent that can pay vendors, but checks proposed functions before they run using Decisions API. The Decisions API provides probabilities for questions about whether the proposed function should run, and your code compares those probabilities to cutoffs to allow, ask about, or block the call before your agent takes action.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-api-answer-gate/README`,children:`Judge Citation Accuracy with Decisions API`}),`: Ask the Agent API a question with web search, score every sentence against its sources with the Decisions API, and send low-scoring sentences back to the Agent API to search again. Your code keeps only the rewrites the sources support.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-api-browser-agent/README`,children:`Drive a Browser with the Decisions API`}),`: Build a browser agent that asks the Decisions API six questions about a numbered screenshot and gets probabilities back. Your code compares them to cutoffs and does the clicking, scrolling, and stopping. One Decisions API request per step, plus retries if needed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/decisions-api-ticket-triage/README`,children:`Triage Support Tickets with the Decisions API`}),`: Route inbound support tickets with three probabilistic questions per ticket from the Decisions API, then send only the escalations to the Agent API.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/agent-api-data-analyst/README`,children:`Build a Data Analytics Agent Using Custom Connectors`}),`: Ask your agent why conversions fell, have it inspect the data, and turn the investigation into a chart for you to review.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/agent-api-regression-testing/README`,children:`Turn Agent Failures into Regression Tests`}),`: Build a web-grounded API troubleshooting advisor, then catch unsafe retry advice and unsupported answers before switching models.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/search-as-code-coding-agents/README`,children:`Search as Code for coding agents`}),`: Use the Perplexity Search SDK to build a source-backed dependency migration packet that any coding agent can inspect before it edits code.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/incident-responder/README`,children:`Build an incident responder with Profiles, Skills, and Managed Connectors`}),`: Combine a saved Profile, an Incident Response Skill, Sandbox, and Datadog, GitHub, and Slack managed connectors, then launch the custom agent with the Agent API.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/customer-enrichment-agent-api/README`,children:`Enrich Customer Data with Agent API`}),`: Use Agent API with people_search to enrich a ClickHouse customer data row and append the result to the table.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/triage-bug-report-connectors/README`,children:`GitHub investigation agent using managed connectors`}),`: Use managed Slack and GitHub connectors to investigate a linked bug report and reply in its Slack thread.`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/docs/cookbook/examples/agent-api-effort/README`,children:`Customizing Effort Levels`})}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/data-story-kimi-k3/README`,children:`Grounded Data Story with Kimi K3`}),`: Turn any topic into a self-contained, source-linked interactive HTML report using Kimi K3, live web search, and the Agent API.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/news-dedupe-digest/README`,children:`Daily News Digest with LLM Deduplication`}),`: Build a daily news digest that reports each story once. One Agent API request runs code in the sandbox to fetch the day’s news, groups coverage into stories, and delivers the digest and a story registry as files.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/agent-skills/README`,children:`Daily AI Stock News PDF with Skills`}),`: Generate a daily one-page AI-industry stock news PDF with the Agent API using the built-in office skill and an inline design skill.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/model-picker/README`,children:`Model Picker`}),`: Describe a task and get a grounded shortlist of open models to use. One Agent API request combines the Hugging Face MCP server with web search to find, verify, and recommend a model.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/talent-sourcer/README`,children:`Talent Sourcer`}),`: Build a vetted engineer sourcing shortlist with one Agent API request. The model works in a Python sandbox - segmenting the brief, calling people_search across sub-segments, verifying each candidate’s role, location, and tenure with web_search, collecting GitHub, social, and publication links, scoring and de-duplicating in code, then rendering an HTML shortlist and sharing it with share_file.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/competitor-buzz-tracker/README`,children:`Competitor Buzz Tracker`}),`: Turn a basket of searches and keyword rules into a one-page share-of-voice chart (PDF) with two chained Agent API requests. The first searches and counts inside the sandbox and returns a structured-output JSON contract. The second renders the bar chart and shares it as a downloadable file.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/langchain-vc-memo-agent/README`,children:`VC Investment Memo Agent with LangGraph`}),`: Build an auditable, citation-grounded VC research agent with LangGraph and the Perplexity Agent API, and pick the best search provider with a LangSmith eval harness.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/multi-provider-orchestration/README`,children:`Multi-Provider Orchestration`}),`: Route between OpenAI, Anthropic, Google, and xAI models through Perplexity’s Agent API with transparent pricing, build fallback chains, and compare providers side-by-side`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/function-calling-e2e/README`,children:`Function Calling End-to-End`}),`: Complete multi-turn function calling patterns for the Perplexity Agent API, including orchestration, web search integration, error handling, and parallel calls`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/embeddings-rag/README`,children:`RAG with Perplexity Embeddings`}),`: Build an end-to-end retrieval-augmented generation pipeline using Perplexity’s standard and contextualized embedding models.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/structured-output-extraction/README`,children:`Structured Output Extraction`}),`: Get typed, schema-validated JSON responses from the Agent API using response_format with JSON schemas for data extraction, pipelines, and structured research`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/academic-search/README`,children:`Academic and Scholarly Search`}),`: Use the Agent API’s domain filtering to restrict search to academic sources, extract DOIs and paper metadata, build citation chains, and create research summaries with proper attribution`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/search-domain-filtering/README`,children:`Search Domain Filtering Patterns`}),`: Use search_domain_filter for focused search — allowlist patterns for trusted sources, denylist for excluding domains, and practical patterns for news, government, and competitive intelligence`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/streaming-citations/README`,children:`Streaming Citation Parsing`}),`: Consume streaming responses from the Agent API and extract, validate, and display citations in real-time as chunks arrive`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/typescript-agent-cli/README`,children:`TypeScript Agent CLI`}),`: An interactive TypeScript CLI with streaming responses, model selection, and web search using the Perplexity Agent API`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/agent-research-assistant/README`,children:`Agent Research Assistant`}),`: A CLI tool that uses Perplexity’s Agent API with the medium effort level to conduct multi-step web research and produce structured reports`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/model-comparison/README`,children:`Multi-Provider Model Comparison`}),`: A CLI tool that sends the same prompt to multiple AI models via Perplexity’s Agent API and compares response quality, latency, and cost`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/search-news-monitor/README`,children:`Search News Monitor`}),`: A CLI tool that uses Perplexity’s Search API to monitor real-time news across multiple configurable topics with domain and recency filtering`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/file-attachment-qa/README`,children:`Document Q\u0026A`}),`: Load documents and ask questions about them via the Agent API — text extraction, web search enrichment, multi-turn Q\u0026A, and structured output extraction`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/document-qa/README`,children:`Document Q\u0026A with Embeddings`}),`: A self-contained RAG system that ingests documents, generates contextualized embeddings, and answers questions using the Agent API`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/image-analysis/README`,children:`Image Analysis`}),`: Vision-powered image analysis with web search for context-enriched results using the Perplexity Agent API`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/sec-filing-search/README`,children:`SEC Filing Search`}),`: Use search domain filtering to query SEC.gov and EDGAR for financial filings, extract key financial data, and build structured financial summaries`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/articles/async-deep-research/README`,children:`Deep Research Workflows`}),`: Use the Agent API medium effort level for comprehensive, multi-step research tasks — synchronous usage, batch concurrency, result processing, and production patterns`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/cookbook/examples/equity-research-brief/README`,children:`Equity Research Brief`}),`: Generate institutional-grade equity research briefs from any public ticker using the Perplexity Agent API and the built-in finance_search tool.`]}),`\n`]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{CookbookGallery,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"slug":"/","title":"Cookbook","sidebarTitle":"Perplexity API Cookbook","description":"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.","keywords":["perplexity","api","cookbook","recipes","examples","agent-api","search-api","embeddings"],"href":"/docs/cookbook/index"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[154,28167,"null;function _creat"]]},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/perplexity/a3bce64cf9d1b46a/section-menu.js","/_mintlify/custom/perplexity/594e3514bce8f9d1/navbar-cta.js","/_mintlify/custom/perplexity/72c576fa3737c96e/singular-tracking.js"],"dynamicCss":".mint-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0\n}\n.mint-pointer-events-none {\n pointer-events: none\n}\n.mint-absolute {\n position: absolute\n}\n.mint-relative {\n position: relative\n}\n.mint-left-4 {\n left: 1rem\n}\n.mint-right-0 {\n right: 0px\n}\n.mint-right-3 {\n right: 0.75rem\n}\n.mint-top-1\\/2 {\n top: 50%\n}\n.mint-z-50 {\n z-index: 50\n}\n.mint-order-1 {\n order: 1\n}\n.mint-order-2 {\n order: 2\n}\n.mint--mx-1 {\n margin-left: -0.25rem;\n margin-right: -0.25rem\n}\n.mint-mx-auto {\n margin-left: auto;\n margin-right: auto\n}\n.mint-mb-2 {\n margin-bottom: 0.5rem\n}\n.mint-mb-3 {\n margin-bottom: 0.75rem\n}\n.mint-mt-2 {\n margin-top: 0.5rem\n}\n.mint-mt-8 {\n margin-top: 2rem\n}\n.mint-line-clamp-2 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2\n}\n.mint-flex {\n display: flex\n}\n.mint-inline-flex {\n display: inline-flex\n}\n.mint-h-3 {\n height: 0.75rem\n}\n.mint-h-3\\.5 {\n height: 0.875rem\n}\n.mint-h-4 {\n height: 1rem\n}\n.mint-h-5 {\n height: 1.25rem\n}\n.mint-max-h-\\[400px\\] {\n max-height: 400px\n}\n.mint-w-3 {\n width: 0.75rem\n}\n.mint-w-3\\.5 {\n width: 0.875rem\n}\n.mint-w-4 {\n width: 1rem\n}\n.mint-w-5 {\n width: 1.25rem\n}\n.mint-w-64 {\n width: 16rem\n}\n.mint-w-full {\n width: 100%\n}\n.mint-max-w-3xl {\n max-width: 48rem\n}\n.mint-flex-1 {\n flex: 1 1 0%\n}\n.mint-shrink-0 {\n flex-shrink: 0\n}\n.mint-cursor-pointer {\n cursor: pointer\n}\n.mint-flex-col {\n flex-direction: column\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-items-center {\n align-items: center\n}\n.mint-items-baseline {\n align-items: baseline\n}\n.mint-justify-center {\n justify-content: center\n}\n.mint-justify-between {\n justify-content: space-between\n}\n.mint-gap-1\\.5 {\n gap: 0.375rem\n}\n.mint-gap-2 {\n gap: 0.5rem\n}\n.mint-gap-2\\.5 {\n gap: 0.625rem\n}\n.mint-gap-3 {\n gap: 0.75rem\n}\n.mint-gap-4 {\n gap: 1rem\n}\n.mint-space-y-0\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.125rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.125rem * var(--tw-space-y-reverse))\n}\n.mint-divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse))\n}\n.mint-overflow-y-auto {\n overflow-y: auto\n}\n.mint-whitespace-nowrap {\n white-space: nowrap\n}\n.mint-rounded {\n border-radius: 0.25rem\n}\n.mint-rounded-full {\n border-radius: 9999px\n}\n.mint-rounded-lg {\n border-radius: 0.5rem\n}\n.mint-border {\n border-width: 1px\n}\n.mint-border-b {\n border-bottom-width: 1px\n}\n.mint-bg-transparent {\n background-color: transparent\n}\n.mint-p-2 {\n padding: 0.5rem\n}\n.mint-px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem\n}\n.mint-px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem\n}\n.mint-px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem\n}\n.mint-px-3\\.5 {\n padding-left: 0.875rem;\n padding-right: 0.875rem\n}\n.mint-px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n}\n.mint-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem\n}\n.mint-py-1\\.5 {\n padding-top: 0.375rem;\n padding-bottom: 0.375rem\n}\n.mint-py-16 {\n padding-top: 4rem;\n padding-bottom: 4rem\n}\n.mint-py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem\n}\n.mint-py-5 {\n padding-top: 1.25rem;\n padding-bottom: 1.25rem\n}\n.mint-pb-2 {\n padding-bottom: 0.5rem\n}\n.mint-pl-11 {\n padding-left: 2.75rem\n}\n.mint-pr-10 {\n padding-right: 2.5rem\n}\n.mint-pt-0\\.5 {\n padding-top: 0.125rem\n}\n.mint-text-center {\n text-align: center\n}\n.mint-text-base {\n font-size: 1rem;\n line-height: 1.5rem\n}\n.mint-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem\n}\n.mint-text-xs {\n font-size: 0.75rem;\n line-height: 1rem\n}\n.mint-font-medium {\n font-weight: 500\n}\n.mint-font-semibold {\n font-weight: 600\n}\n.mint-tabular-nums {\n --tw-numeric-spacing: tabular-nums;\n font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)\n}\n.mint-opacity-70 {\n opacity: 0.7\n}\n.mint-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n}\n.mint-transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms\n}\n.hover\\:mint-bg-\\[var\\(--cb-hover\\)\\]:hover {\n background-color: var(--cb-hover)\n}\n.hover\\:mint-bg-\\[var\\(--color-card\\)\\]:hover {\n background-color: var(--color-card)\n}\n.focus\\:mint-outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px\n}\n.focus\\:mint-ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)\n}\n.mint-group:hover .group-hover\\:mint-underline {\n text-decoration-line: underline\n}\n@media (min-width: 640px) {\n .sm\\:mint-order-1 {\n order: 1\n }\n .sm\\:mint-order-2 {\n order: 2\n }\n .sm\\:mint--mx-3 {\n margin-left: -0.75rem;\n margin-right: -0.75rem\n }\n .sm\\:mint-flex-row {\n flex-direction: row\n }\n .sm\\:mint-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem\n }\n}","subdomain":"perplexity","siteName":"Perplexity","title":"Cookbook - Perplexity","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T23:21:21.261Z","originalFileLocation":"docs/cookbook/index.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Perplexity\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cookbook - Perplexity\">\u003cmeta data-mint-head property=\"og:description\" content=\"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Perplexity\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.perplexity.ai/docs/cookbook\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://perplexity.mintlify.app/_mintlify/api/og/v2?division=Cookbook\u0026amp;title=Cookbook\u0026amp;description=Guides%2C+runnable+examples%2C+and+community+projects+for+building+with+the+Perplexity+Agent%2C+Search%2C+and+Embeddings+APIs.+Search+or+filter+by+product+and+category.\u0026amp;theme=0c682f4b9a1b4bccaac4b8e9\u0026amp;signature=3ab86be665921b5d5a2ac2c09fa5d29641d7a7e5a1f7f2e8d74eca56ba99ecb6\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Cookbook - Perplexity\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://perplexity.mintlify.app/_mintlify/api/og/v2?division=Cookbook\u0026amp;title=Cookbook\u0026amp;description=Guides%2C+runnable+examples%2C+and+community+projects+for+building+with+the+Perplexity+Agent%2C+Search%2C+and+Embeddings+APIs.+Search+or+filter+by+product+and+category.\u0026amp;theme=0c682f4b9a1b4bccaac4b8e9\u0026amp;signature=3ab86be665921b5d5a2ac2c09fa5d29641d7a7e5a1f7f2e8d74eca56ba99ecb6\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/perplexity/rSPP83rcZL_iw-xo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Perplexity\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#121516\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"l-0uTKc1Uf60LaNt0Pkw1wLOBFEKoBIhUrv0EMr1J4U\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.perplexity.ai/docs/cookbook\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/cookbook/index.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.perplexity.ai/#organization\",\"name\":\"Perplexity\",\"url\":\"https://docs.perplexity.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/perplexity/gHf_T6roVjp3yaJv/logo/Perplexity_API_Platform.svg?fit=max\u0026auto=format\u0026n=gHf_T6roVjp3yaJv\u0026q=85\u0026s=07cab879ca2ce031bbc3da8b20f7ab90\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.perplexity.ai#website\",\"name\":\"Perplexity\",\"url\":\"https://docs.perplexity.ai\",\"publisher\":{\"@id\":\"https://docs.perplexity.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.perplexity.ai/docs/cookbook#webpage\",\"url\":\"https://docs.perplexity.ai/docs/cookbook\",\"name\":\"Cookbook\",\"description\":\"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.\",\"dateModified\":\"2026-10-27T23:21:21.261Z\",\"isPartOf\":{\"@id\":\"https://docs.perplexity.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.perplexity.ai/docs/cookbook#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.perplexity.ai/docs/cookbook#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Cookbook\",\"item\":\"https://docs.perplexity.ai/docs/cookbook/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cookbook\",\"item\":\"https://docs.perplexity.ai/docs/cookbook\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.perplexity.ai/docs/cookbook#article\",\"headline\":\"Cookbook\",\"name\":\"Cookbook\",\"description\":\"Guides, runnable examples, and community projects for building with the Perplexity Agent, Search, and Embeddings APIs. Search or filter by product and category.\",\"url\":\"https://docs.perplexity.ai/docs/cookbook\",\"mainEntityOfPage\":{\"@id\":\"https://docs.perplexity.ai/docs/cookbook#webpage\"},\"dateModified\":\"2026-10-27T23:21:21.261Z\",\"keywords\":\"perplexity, api, cookbook, recipes, examples, agent-api, search-api, embeddings\",\"publisher\":{\"@id\":\"https://docs.perplexity.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.perplexity.ai#website\"}}]}\u003c/script>","siteName":"Perplexity","nav":{"global":{"anchors":[{"anchor":"Community","icon":{"style":"regular","name":"message-circle"},"href":"https://community.perplexity.ai"},{"anchor":"Blog","icon":{"style":"regular","name":"pencil"},"href":"https://research.perplexity.ai/articles"},{"anchor":"Changelog","icon":{"style":"regular","name":"clock"},"href":"/docs/resources/changelog"}]},"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/docs/getting-started/overview"}]},{"tab":"Cookbook","groups":[{"group":"Cookbook","pages":[{"title":"Cookbook","sidebarTitle":"Perplexity API Cookbook","href":"/docs/cookbook"},{"title":"Getting Started","description":"How to use the Perplexity API Cookbook, plus a quick start for getting your API key and installing the SDK.","href":"/docs/cookbook/getting-started"},{"group":"Community Showcase","pages":[{"title":"Community Showcase","sidebarTitle":"Community Showcase","href":"/docs/cookbook/showcase/index"}]},{"group":"Examples","pages":[{"title":"Examples Overview","href":"/docs/cookbook/examples/README"},{"title":"Document Q\u0026A with Embeddings","href":"/docs/cookbook/examples/document-qa/README"},{"title":"Agent Research Assistant","href":"/docs/cookbook/examples/agent-research-assistant/README"},{"title":"Equity Research Brief","href":"/docs/cookbook/examples/equity-research-brief/README"},{"title":"TypeScript Agent CLI","href":"/docs/cookbook/examples/typescript-agent-cli/README"},{"title":"Image Analysis","href":"/docs/cookbook/examples/image-analysis/README"},{"title":"Multi-Provider Model Comparison","href":"/docs/cookbook/examples/model-comparison/README"},{"title":"Document Q\u0026A","href":"/docs/cookbook/examples/file-attachment-qa/README"},{"title":"Search News Monitor","href":"/docs/cookbook/examples/search-news-monitor/README"},{"title":"SEC Filing Search","href":"/docs/cookbook/examples/sec-filing-search/README"},{"title":"Competitor Buzz Tracker","href":"/docs/cookbook/examples/competitor-buzz-tracker/README"},{"title":"Talent Sourcer","href":"/docs/cookbook/examples/talent-sourcer/README"},{"title":"Enrich Customer Data with Agent API","href":"/docs/cookbook/examples/customer-enrichment-agent-api/README"},{"title":"Model Picker","href":"/docs/cookbook/examples/model-picker/README"},{"title":"Grounded Data Story with Kimi K3","href":"/docs/cookbook/examples/data-story-kimi-k3/README"},{"title":"Customizing Effort Levels","href":"/docs/cookbook/examples/agent-api-effort/README"},{"title":"GitHub investigation agent using managed connectors","href":"/docs/cookbook/examples/triage-bug-report-connectors/README"},{"title":"Triage Support Tickets with the Decisions API","href":"/docs/cookbook/examples/decisions-api-ticket-triage/README"},{"title":"Drive a Browser with the Decisions API","href":"/docs/cookbook/examples/decisions-api-browser-agent/README"},{"title":"Judge Citation Accuracy with Decisions API","href":"/docs/cookbook/examples/decisions-api-answer-gate/README"},{"title":"Check Agent Actions Before They Run with Decisions API","href":"/docs/cookbook/examples/decisions-api-action-gate/README"},{"title":"Rank Search Results to Answer Questions with the Best Quote Using Decisions API","href":"/docs/cookbook/examples/decisions-quote-finder/README"},{"title":"Catch Visual Bugs in CI with the Decisions API","href":"/docs/cookbook/examples/decisions-api-visual-qa-gate/README"},{"title":"Check a Chart for Misleading Design with a Decision Model","href":"/docs/cookbook/examples/decisions-api-chart-check/README"},{"title":"Enrich a CSV of Companies Overnight with the Batch API","href":"/docs/cookbook/examples/batch-api-company-enrichment/README"},{"title":"Track What the Web Said Each Week About a Topic, and Build a Report","href":"/docs/cookbook/examples/agent-api-story-timeline/README"},{"title":"Build a Data Analytics Agent Using Custom Connectors","href":"/docs/cookbook/examples/agent-api-data-analyst/README"},{"title":"Turn Agent Failures into Regression Tests","href":"/docs/cookbook/examples/agent-api-regression-testing/README"}]},{"group":"Guides","pages":[{"title":"RAG with Perplexity Embeddings","href":"/docs/cookbook/articles/embeddings-rag/README"},{"title":"Streaming Citation Parsing","href":"/docs/cookbook/articles/streaming-citations/README"},{"title":"Structured Output Extraction","href":"/docs/cookbook/articles/structured-output-extraction/README"},{"title":"Multi-Provider Orchestration","href":"/docs/cookbook/articles/multi-provider-orchestration/README"},{"title":"Academic and Scholarly Search","href":"/docs/cookbook/articles/academic-search/README"},{"title":"Deep Research Workflows","href":"/docs/cookbook/articles/async-deep-research/README"},{"title":"Search Domain Filtering Patterns","href":"/docs/cookbook/articles/search-domain-filtering/README"},{"title":"VC Investment Memo Agent with LangGraph","href":"/docs/cookbook/articles/langchain-vc-memo-agent/README"},{"title":"Daily AI Stock News PDF with Skills","href":"/docs/cookbook/articles/agent-skills/README"},{"title":"Daily News Digest with LLM Deduplication","href":"/docs/cookbook/articles/news-dedupe-digest/README"},{"title":"Build an incident responder with Profiles, Skills, and Managed Connectors","sidebarTitle":"Incident responder","href":"/docs/cookbook/articles/incident-responder/README"},{"title":"Function Calling End-to-End","href":"/docs/cookbook/articles/function-calling-e2e/README"},{"title":"Search as Code for coding agents","sidebarTitle":"Search as Code for coding agents","href":"/docs/cookbook/articles/search-as-code-coding-agents/README"}]}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/gateway-chat-completions-post"}]}]},"title":"Cookbook - Perplexity","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["10e4515597"],"chunks":["BannerMarkdown-B-Glu166.js","dist-zbf22OZA.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-Cs6nMGht.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}