1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64562],{54251:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/developers/v1/guides/palm-reading",function(){return n(21766)}])},80397:function(e,t,n){"use strict";var a=n(85893),s=n(67294);t.Z=e=>{let{open:t,onClose:n,sampleQuestions:r=[],inputValue:l,onInputChange:i,onSubmit:d,onQuestionSelect:o}=e;return(0,s.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),(0,a.jsxs)("div",{className:"fixed inset-0 z-50 transition ".concat(t?"pointer-events-auto":"pointer-events-none"),children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-slate-950/40 transition-opacity duration-300 ".concat(t?"opacity-100":"opacity-0"),onClick:n}),(0,a.jsxs)("aside",{className:"absolute right-0 top-0 flex h-full w-full max-w-md flex-col border-l border-slate-200 bg-white shadow-2xl transition-transform duration-300 ".concat(t?"translate-x-0":"translate-x-full"),"aria-hidden":!t,children:[(0,a.jsxs)("header",{className:"flex items-start justify-between px-6 py-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.28em] text-brand-primary",children:"Ask AI"}),(0,a.jsx)("h2",{className:"mt-1 text-2xl font-semibold text-slate-900",children:"How can we help?"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-slate-600",children:"Ask about endpoints, SDKs, or best practices. Weâll surface docs and tips instantly."})]}),(0,a.jsx)("button",{onClick:n,className:"rounded-full border border-slate-200 p-2 text-slate-500 transition hover:border-slate-300 hover:text-slate-700","aria-label":"Close AI panel",children:(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[(0,a.jsx)("path",{d:"M18 6 6 18"}),(0,a.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 pb-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-slate-900",children:"Quick suggestions"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>(0,a.jsx)("button",{onClick:()=>null==o?void 0:o(e),className:"rounded-full border border-slate-200 px-3 py-2 text-sm text-slate-600 transition hover:border-brand-primary/60 hover:text-brand-primary",children:e},e))})]}),(0,a.jsxs)("div",{className:"mt-8 space-y-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-slate-900",children:"Recent answers"}),(0,a.jsx)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50/60 p-4 text-sm text-slate-600",children:(0,a.jsx)("p",{children:"Ask anything about integrating AstrologyAPIâauthentication, SDK usage, PDF toolkits, or release changes. Weâll bring the best docs snippet straight to you."})})]})]}),(0,a.jsx)("footer",{className:"border-t border-slate-200 bg-white px-6 py-5",children:(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),null==d||d()},className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Ask a question"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-2xl border border-slate-200 bg-slate-50 px-3 py-2",children:[(0,a.jsx)("textarea",{value:l,onChange:e=>null==i?void 0:i(e.target.value),rows:2,placeholder:"How do I fetch the daily horoscope?",className:"w-full resize-none bg-transparent text-sm text-slate-700 outline-none"}),(0,a.jsx)("button",{type:"submit",className:"rounded-full bg-brand-primary px-4 py-2 text-sm font-semibold text-white shadow-[0_12px_30px_rgba(99,91,255,0.35)] transition hover:bg-brand-primary-hover",children:"Send"})]})]})})]})]})}},37601:function(e,t,n){"use strict";var a=n(85893),s=n(67294),r=n(10005);t.Z=e=>{let{navSections:t,activeSectionKey:n=null,currentSlug:l=null,routePrefix:i="/developers/v1",fullWidth:d=!1,showTableOfContents:o=!0,className:c="",children:p}
1=e,[x,h]=(0,s.useState)(!1),[m,y]=(0,s.useState)([]),[u,g]=(0,s.useState)(""),j=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=j.current;if(!e)return;let t=Array.from(e.querySelectorAll("h2, h3")),n=new Set,a=t.map((e,t)=>{let a=e.id||(e.textContent||"").toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")||"section-".concat(t);if(n.has(a)){let e=a,t=2;for(;n.has("".concat(e,"-").concat(t));)t+=1;a="".concat(e,"-").concat(t)}return n.add(a),e.id=a,{id:a,text:e.textContent||"",level:"H3"===e.tagName?3:2}});if(y(a),0===a.length)return;let s=new IntersectionObserver(e=>{var t;let n=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top)[0];(null==n?void 0:null===(t=n.target)||void 0===t?void 0:t.id)&&g(n.target.id)},{rootMargin:"-30% 0px -60% 0px",threshold:0});return t.forEach(e=>s.observe(e)),()=>s.disconnect()},[p]),(0,a.jsxs)("div",{className:"min-h-screen bg-primary-bg font-plus_jakarta_sans",children:[(0,a.jsx)("div",{className:"lg:hidden border-b border-border-color bg-primary-bg px-5 py-2.5",children:(0,a.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"inline-flex items-center gap-2 text-sm font-medium text-secondary-text",children:[(0,a.jsx)("span",{"aria-hidden":"true",children:"â°"})," Menu"]})}),(0,a.jsxs)("div",{className:"flex w-full items-start",children:[(0,a.jsx)(r.Z,{navSections:t,activeSectionKey:n,currentSlug:l,routePrefix:i,mobileOpen:x,onClose:()=>h(!1)}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col xl:flex-row",children:[(0,a.jsx)("div",{className:"flex-1 min-w-0 flex justify-center",children:(0,a.jsx)("article",{ref:j,className:"docs-v2-desc w-full ".concat(d?"max-w-none":"max-w-[720px]"," px-5 lg:px-10 py-12 ").concat(c),children:p})}),o&&(0,a.jsx)("div",{className:"hidden xl:block w-[240px] shrink-0 px-6 py-12",children:(0,a.jsx)("div",{className:"sticky self-start",style:{top:"129px"},children:m.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-tertiary-text mb-3",children:"On this page"}),(0,a.jsx)("nav",{className:"flex flex-col gap-1 border-l border-border-color",children:m.map(e=>{let t=e.id===u;return(0,a.jsx)("a",{href:"#".concat(e.id),className:"-ml-px border-l pl-3 py-1 text-sm transition-colors ".concat(3===e.level?"pl-6":""," ").concat(t?"font-medium text-primary-text":"text-tertiary-text hover:text-secondary-text"),style:{borderColor:t?"var(--accent-primary)":"transparent"},children:e.text},e.id)})})]})})})]})]})]})}},21766:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return N}});var a=n(85893),s=n(9008),r=n.n(s),l=n(41664),i=n.n(l),d=n(67294),o=n(10774),c=n(8802),p=n(53273),x=n(43550),h=n(80397),m=n(37601),y=n(92910);let u=y.AO,g=u.find(e=>"guides"===e.id),j="Add palm reading to your app",f="Scan a palm photo into a palm_id, then call palm analysis and reading endpoints for hand type, lines, mounts, and personality, career, and love readings.",b={"@context":"https://schema.org","@type":"TechArticle",headline:j,description:f,author:{"@type":"Organization",name:"AstrologyAPI"},datePublished:"2026-07-18"},CodeBlock=e=>{let{code:t}=e,[n,s]=(0,d.useState)(!1);return(0,a.jsxs)("div",{className:"relative rounded-lg overflow-hidden mb-4",style:{background:"#0d0f14",border:"1px solid #1e242c"},children:[(0,a.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)},className:"absolute top-2 right-2 text-[11px] uppercase tracking-wider px-2 py-1 rounded",style:{color:"#8b95a3"},children:n?"Copied":"Copy"}),(0,a.jsx)("pre",{className:"p-4 text-[13px] leading-relaxed overflow-x-auto",style:{color:"#e2e8f0",fontFamily:"'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace"},children:(0,a.jsx)("code",{children:t})})]})},InlineCode=e=>{let{children:t}=e;return(0,a.jsx)("code",{className:"rounded bg-accent-surface px-1.5 py-0.5 text-accent-primary",children:t})},PalmReadingGuide=e=>{let{navSections:t=[]}=e,[n,s]=(0,d.useState)("documentation"),[l,o]=(0,d.useState)(!1),[y,N]=(0,d.useState)(!1),[v,w]=(0,d.useState)("");(0,d.useEffect)(()=>{let handleShortcut=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),o(!0))};return window.addEventListener("keydown",handleShortcut),()=>window.removeEventListener("keydown",handleShortcut)},[]);let I=(0,d.useMemo)(()=>u.map(e=>{let{id:t,label:n,icon:a,pageLink:s,hidden:r}=e;return{id:t,label:n,icon:a,href:s,hidden:r}}),[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r(),{children:[(0,a.jsx)("title",{children:j}),(0,a.jsx)("meta",{name:"description",content:f}),(0,a.jsx)("link",{rel:"canonical",href:"https://astrologyapi.com/developers/v1/guides/palm-reading"}),(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(b)}})]}),(0,a.jsx)(p.Z,{isModalOpen:l,children:(0,a.jsx)(x.Z,{handleSearchModal:()=>{o(e=>!e)},externallyInvokedData:{query:"",category:n},isInvokedExternally:!0})}),(0,a.jsx)(c.Z,{items:I,activeItem:"guides",onSearch:()=>{s("documentation"),o(!0)},onAskAI:()=>{s("general"),w(""),N(!0)}}),(0,a.jsxs)(m.Z,{navSections:t,activeSectionKey:null,currentSlug:null,routePrefix:"/developers/v1",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-accent-primary",children:"Guides"}),(0,a.jsx)("h1",{className:"mt-3 text-4xl font-bold tracking-tight text-primary-text",children:"Add palm reading to your app"}),(0,a.jsxs)("p",{className:"mt-4 text-base leading-relaxed text-secondary-text",children:["The palm reading API reads a photo of a hand with a vision model. The API extracts structured features from the photo and stores them under one ",(0,a.jsx)(Inl
1ineCode,{children:"palm_id"}),"."]}),(0,a.jsx)("p",{className:"mt-4 text-base leading-relaxed text-secondary-text",children:"From that ID you can pull hand-shape data, line-by-line analysis, and category readings such as career, love, and health. Each reading is its own endpoint call."}),(0,a.jsx)("h2",{className:"mt-14 scroll-mt-[140px] text-2xl font-bold tracking-tight text-primary-text",children:"How the flow works"}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["Every palm reading is two steps. Step one submits a photo once and returns a ",(0,a.jsx)(InlineCode,{children:"palm_id"}),". Step two calls as many analysis and reading endpoints as you need, each one keyed off that same ",(0,a.jsx)(InlineCode,{children:"palm_id"}),"."]}),(0,a.jsx)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:"Category readings, such as career or love, are not generated during the scan. The API generates each one on demand, the first time you call its endpoint."}),(0,a.jsxs)("div",{className:"mt-6 rounded-[10px] border border-border-color border-l-2 border-l-accent-primary bg-accent-surface p-4 text-sm leading-relaxed text-secondary-text",children:["The palm reading API lives on a different host than the rest of AstrologyAPI. Every endpoint in this guide is served from"," ",(0,a.jsx)(InlineCode,{children:"https://vision.astrologyapi.com/palmistry"}),", not ",(0,a.jsx)(InlineCode,{children:"json.astrologyapi.com"}),". Authenticate the same way as the rest of the API: HTTP Basic, with your user ID as the username and your API key as the password."]}),(0,a.jsx)("h3",{className:"mt-8 text-xl font-bold tracking-tight text-primary-text",children:"Step 1: submit the photo"}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:[(0,a.jsx)(InlineCode,{children:"get-palm-id"})," takes an image, plus the subject's date of birth and gender. The call returns the ID that every other endpoint needs."]}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["The ",(0,a.jsx)(InlineCode,{children:"image_url"})," field accepts either a public image URL or a base64 data URL (",(0,a.jsx)(InlineCode,{children:"data:image/...;base64,..."}),")."]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"mt-6 text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left font-semibold text-primary-text border-b border-border-color",children:[(0,a.jsx)("th",{className:"py-2 pr-4",children:"Field"}),(0,a.jsx)("th",{className:"py-2 pr-4",children:"Type"}),(0,a.jsx)("th",{className:"py-2 pr-4",children:"Required"}),(0,a.jsx)("th",{className:"py-2 pr-4",children:"Description"})]})}),(0,a.jsxs)("tbody",{children:[(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"image_url"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"string"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Yes"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Public image URL or base64 data URL of the palm photo. Accepts jpeg, jpg, png, or webp, up to 5MB."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsxs)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:[(0,a.jsx)(InlineCode,{children:"day"}),","," ",(0,a.jsx)(InlineCode,{children:"month"}),","," ",(0,a.jsx)(InlineCode,{children:"year"})]}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"number"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Yes"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Date of birth of the person the palm belongs to."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"gender"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"string"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Yes"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Gender of the person the palm belongs to."})]})]})]})}),(0,a.jsx)(CodeBlock,{code:'POST https://vision.astrologyapi.com/palmistry/get-palm-id\n\n{\n "image_url": "https://sample_image.jpg",\n "day": 30,\n "month": 7,\n "year": 2000,\n "gender": "male"\n}\n\nResponse:\n{\n "status": true,\n "message": "success",\n "data": {\n "palm_id": "c48d0b80-1d49-4af8-8c05-e778b3d7a00f"\n }\n}'}),(0,a.jsx)("h3",{className:"mt-8 text-xl font-bold tracking-tight text-primary-text",children:"Step 2: call the endpoints you need"}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["Every other palmistry endpoint takes the same single field,"," ",(0,a.jsx)(Inl
1ineCode,{children:"palm_id"}),", and returns a different slice of the scan. Two groups exist. Analysis endpoints return structured feature data. Reading endpoints return an interpretation built from that data."]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"mt-6 text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left font-semibold text-primary-text border-b border-border-color",children:[(0,a.jsx)("th",{className:"py-2 pr-4",children:"Endpoint"}),(0,a.jsx)("th",{className:"py-2 pr-4",children:"Group"}),(0,a.jsx)("th",{className:"py-2 pr-4",children:"Returns"})]})}),(0,a.jsxs)("tbody",{children:[(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"hand-type"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Analysis"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Hand shape, element, skin texture, elasticity."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"fingers"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Analysis"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"General finger length and spacing."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"major-lines"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Analysis"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Heart, head, life, and fate line details."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"minor-lines"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Analysis"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Secondary line detail beyond the four major lines."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"mounts"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Analysis"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm mount analysis."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"special-features"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Analysis"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Distinctive marks on the palm."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"personality"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Readings"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Core traits, behavioral style, strengths."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsxs)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:[(0,a.jsx)(InlineCode,{children:"career"}),","," ",(0,a.jsx)(InlineCode,{children:"money"}),","," ",(0,a.jsx)(InlineCode,{children:"love"}),","," ",(0,a.jsx)(InlineCode,{children:"marriage"}),","," ",(0,a.jsx)(InlineCode,{children:"health"}),","," ",(0,a.jsx)(InlineCode,{children:"challenges"}),","," ",(0,a.jsx)(InlineCode,{children:"luck"})]}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Readings"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Category-specific interpretive reading."})]}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:(0,a.jsx)(InlineCode,{children:"get-palm-image"})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Palm Readings"}),(0,a.jsx)("td",{className:"py-2 pr-4 text-secondary-text align-top",children:"Processed palm image."})]})]})]})}),(0,a.jsxs)("p",{className:"mt-6 leading-relaxed text-secondary-text",children:[(0,a.jsx)(Inl
1ineCode,{children:"hand-type"}),", ",(0,a.jsx)(InlineCode,{children:"major-lines"}),", and ",(0,a.jsx)(InlineCode,{children:"personality"})," below show the full request and response shape. The remaining endpoints in the table follow the same one-field ",(0,a.jsx)(InlineCode,{children:"palm_id"})," request pattern."]}),(0,a.jsx)(CodeBlock,{code:'POST https://vision.astrologyapi.com/palmistry/hand-type\n\n{\n "palm_id": "c48d0b80-1d49-4af8-8c05-e778b3d7a00f"\n}\n\nResponse:\n{\n "status": true,\n "data": {\n "shape": "square",\n "element": "Earth",\n "skin_texture": "smooth",\n "elasticity": "flexible"\n }\n}'}),(0,a.jsx)(CodeBlock,{code:'POST https://vision.astrologyapi.com/palmistry/major-lines\n\n{\n "palm_id": "c48d0b80-1d49-4af8-8c05-e778b3d7a00f"\n}\n\nResponse:\n{\n "status": true,\n "data": {\n "heart_line": {\n "shape": "curved",\n "depth": "deep",\n "starting_point": "below index finger",\n "quality": "clear"\n },\n "head_line": {\n "shape": "straight",\n "depth": "medium",\n "starting_point": "between thumb and index"\n },\n "life_line": {\n "shape": "wide curve",\n "depth": "deep",\n "quality": "clear",\n "fork": "absent"\n },\n "fate_line": {\n "presence": "present",\n "origin": "wrist"\n }\n }\n}'}),(0,a.jsx)(CodeBlock,{code:'POST https://vision.astrologyapi.com/palmistry/personality\n\n{\n "palm_id": "c48d0b80-1d49-4af8-8c05-e778b3d7a00f"\n}\n\nResponse:\n{\n "status": true,\n "data": {\n "personality": {\n "core_traits": [\n "Practical and grounded",\n "Independent thinker",\n "Reliable under pressure"\n ],\n "behavioral_style": "Methodical and detail-oriented, prefers structured environments",\n "strengths": [\n "Strong focus",\n "Loyalty",\n "Patience"\n ]\n }\n }\n}'}),(0,a.jsx)("h2",{className:"mt-14 scroll-mt-[140px] text-2xl font-bold tracking-tight text-primary-text",children:"Complete example"}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["This example runs on Node 18 or later with the global"," ",(0,a.jsx)(InlineCode,{children:"fetch"}),", no packages. The script reads a photo from disk and encodes the photo as a base64 data URL."]}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["The script then scans the photo into a"," ",(0,a.jsx)(InlineCode,{children:"palm_id"}),". It fetches hand type, major lines, and a personality reading in parallel. Set"," ",(0,a.jsx)(InlineCode,{children:"USER_ID"})," and ",(0,a.jsx)(InlineCode,{children:"API_KEY"})," ","from your dashboard."]}),(0,a.jsx)(CodeBlock,{code:"// Node 18+ (global fetch). No external packages.\n// USER_ID and API_KEY come from your AstrologyAPI dashboard.\nconst fs = require('fs')\n\nconst USER_ID = 'USER_ID'\nconst API_KEY = 'API_KEY'\n\nconst BASE_URL = 'https://vision.astrologyapi.com/palmistry'\nconst AUTH =\n 'Basic ' + Buffer.from(USER_ID + ':' + API_KEY).toString('base64')\n\nasync function post(endpoint, body) {\n const res = await fetch(BASE_URL + '/' + endpoint, {\n method: 'POST',\n headers: {\n Authorization: AUTH,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n })\n if (!res.ok) {\n throw new Error(endpoint + ' failed: ' + res.status + ' ' + res.statusText)\n }\n return res.json()\n}\n\nasync function scanPalm(imagePath, birth) {\n // 1. Read the photo from disk and send it as a base64 data URL.\n // A public image URL works the same way in the image_url field.\n const buffer = fs.readFileSync(imagePath)\n const imageUrl = 'data:image/jpeg;base64,' + buffer.toString('base64')\n\n const scan = await post('get-palm-id', {\n image_url: imageUrl,\n day: birth.day,\n month: birth.month,\n year: birth.year,\n gender: birth.gender,\n })\n const palmId = scan.data.palm_id\n\n // 2. Call whichever analysis and reading endpoints your product needs,\n // all keyed off the same palm_id.\n const [handType, majorLines, personality] = await Promise.all([\n post('hand-type', { palm_id: palmId }),\n post('major-lines', { palm_id: palmId }),\n post('personality', { palm_id: palmId }),\n ])\n\n return {\n palmId,\n handType: handType.data,\n majorLines: majorLines.data,\n personality: personality.data,\n }\n}\n\nscanPalm('./palm.jpg', {\n day: 30,\n month: 7,\n year: 2000,\n gender: 'male',\n})\n .then((result) => console.log(JSON.stringify(result, null, 2)))\n .catch((err) => {\n console.error(err.message)\n process.exit(1)\n })"}),(0,a.jsxs)("div",{className:"mt-6 rounded-[10px] border border-border-color border-l-2 border-l-accent-primary bg-accent-surface p-4 text-sm leading-relaxed text-secondary-text",children:["The API rejects requests from browsers (CORS), so route every call through your server. Never put your API key in client-side code. If you need to call from a client, use a short-lived access token instead. See the"," ",(0,a.jsx)(i(),{href:"/developers/v1/access-token-usage-guide",className:"font-semibold text-accent-primary underline",children:"access token usage guide"}),"."]}),(0,a.jsx)("h2",{className:"mt-14 scroll-mt-[140px] text-2xl font-bold tracking-tight text-primary-text",children:"Photo quality"}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["The documented constraint is on file type and size:"," ",(0,a.jsx)(Inl
1ineCode,{children:"get-palm-id"})," accepts jpeg, jpg, png, or webp, up to 5MB."]}),(0,a.jsx)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:"A vision model reading lines from a photo does best with a clear, well-lit, in-focus shot of an open palm. Guide users toward that kind of photo before they submit."}),(0,a.jsx)("h2",{className:"mt-14 scroll-mt-[140px] text-2xl font-bold tracking-tight text-primary-text",children:"What the API returns vs. what your product adds"}),(0,a.jsx)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:"The API returns structured feature data: line shapes, hand element, and finger spacing. Per category, the API also returns an interpretive reading built from that data."}),(0,a.jsx)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:"The API does not render a UI, and the API does not add disclaimers. Your product makes three decisions."}),(0,a.jsxs)("ul",{className:"mt-4 list-disc space-y-2 pl-5 marker:text-tertiary-text",children:[(0,a.jsx)("li",{className:"text-secondary-text leading-relaxed",children:"How to present the reading."}),(0,a.jsx)("li",{className:"text-secondary-text leading-relaxed",children:"Whether to combine several categories into one report."}),(0,a.jsx)("li",{className:"text-secondary-text leading-relaxed",children:"Whether to label the result as an interpretive reading rather than a diagnosis."})]}),(0,a.jsxs)("p",{className:"mt-4 leading-relaxed text-secondary-text",children:["The API generates a category reading on the first call to its endpoint and stores the reading against the"," ",(0,a.jsx)(InlineCode,{children:"palm_id"}),". Fetch only the categories a user asks for, rather than every endpoint on every scan."]}),(0,a.jsx)("h2",{className:"mt-14 scroll-mt-[140px] text-2xl font-bold tracking-tight text-primary-text",children:"Where to go next"}),(0,a.jsxs)("ul",{className:"mt-4 list-disc space-y-2 pl-5 marker:text-tertiary-text",children:[(0,a.jsxs)("li",{className:"text-secondary-text leading-relaxed",children:[(0,a.jsx)(i(),{href:"/developers/v1/guides/production-checklist",className:"font-semibold text-accent-primary underline",children:"Credits, errors, and going to production"})," ","before you point real user traffic at these endpoints."]}),(0,a.jsxs)("li",{className:"text-secondary-text leading-relaxed",children:[(0,a.jsx)(i(),{href:"/developers/v1/guides/llm-grounding",className:"font-semibold text-accent-primary underline",children:"Ground an LLM on computed charts"})," ","if you want an LLM to narrate a combined reading instead of a template."]}),(0,a.jsxs)("li",{className:"text-secondary-text leading-relaxed",children:[(0,a.jsx)(i(),{href:"/developers/v1/palm-reading-api",className:"font-semibold text-accent-primary underline",children:"Palm reading API reference"})," ","for the full parameter and response documentation on every endpoint in this guide."]})]})]}),(0,a.jsx)(h.Z,{open:y,onClose:()=>N(!1),sampleQuestions:(null==g?void 0:g.sampleQuestions)||[],inputValue:v,onInputChange:w,onSubmit:()=>{w("")},onQuestionSelect:e=>w(e)})]})};PalmReadingGuide.getLayout=function(e){return(0,a.jsx)(o.Z,{buttonColor:"indigo",hideSearchBar:!1,hideContactSalesButton:!0,contentPaddingTop:"",children:e})};var N=!0;t.default=PalmReadingGuide},9008:function(e,t,n){e.exports=n(79201)}},function(e){e.O(0,[3660,49774,92888,40179],function(){return e(e.s=54251)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.