Copy page

Copy page as Markdown for LLMs

View as Markdown

View this page as plain text


Open in ChatGPT

Ask ChatGPT about this page

Open in Claude

Ask Claude about this page

Heartbreak Reading API

Introducing the Heartbreak Reading API, a compassionate tool that provides users with personalized emotional insights and guidance during times of emotional pain. This API helps you deliver supportive, reflective readings to those navigating heartbreak, offering both clarity and healing through the wisdom of tarot.


Step by Step Heartbreak Reading API Postman Testing Integration

Step by Step Heartbreak Reading API Postman Testing Integration


API Endpoint for English

POST https://astroapi-5.divineapi.com/api/v2/heartbreak-reading

Guide: If you only need English, use this endpoint.


API Endpoint for other languages

POST https://astroapi-5-translator.divineapi.com/api/v2/heartbreak-reading

Guide: If you want the response in any other language use this translator endpoint.


Supported Language Codes

Use the lan parameter in the request body to select your preferred language for the API response.

Supported Reference Article:
https://support.divineapi.com/general-api-support/translating-apis-into-a-different-language

CodeLanguage
enEnglish
hiHindi
zhChinese
jaJapanese
arArabic
ruRussian
ptPortuguese
esSpanish
frFrench
deGerman
itItalian
nlDutch
plPolish
trTurkish
ukUkrainian
huHungarian
grGreek
bnBengali
maMarathi
tmTamil
tlTelugu
mlMalayalam
knKannada
taFilipino/Tagalog
bahIndonesian

Guide: Ensure that your translator configuration is up to date via DivineAPI Translator.


Headers

NameTypeDescription
Authorization*StringYour API Access Token. Example: Bearer {token}

Request Body

NameTypeDescription
api_key*StringYour DivineAPI Key (available in your developer dashboard).
card_imageIntegerChoose the card image variant (1 / 2 / 3). Default value: 1.
lanStringLanguage code (default: en). How to update translator.

200: OK Successful

{
    "success": 1,
    "data": {
        "prediction": {
            "card1": "THE HIEROPHANT",
            "card2": "THE EMPEROR",
            "card1_image": "https://divineapi.com/admin/uploads/tarot-breakup/6.png",
            "card2_image": "https://divineapi.com/admin/uploads/tarot-breakup/5.png",
            "cause": "You have likely experienced a situation where you and your partner had differing views on the purpose and expectations of your relationship. Perhaps you wanted a traditional, committed union, while your partner preferred an unconventional arrangement. Despite being in love, your relationship was unable to flourish due to the conflicting values. In the end, it was probably better for both of you to part ways so that you could maintain a friendship. While it may have been difficult to end the romantic aspect of your relationship, it is possible to still maintain a meaningful connection with your ex-partner. By recognizing and respecting each other's differences, you can work towards a healthy and positive friendship. Remember that not all relationships are meant to last forever, but that doesn't mean they weren't valuable experiences that helped shape you into the person you are today.",
            "advise": "It sounds like your past relationship was marked by an imbalance in power. Perhaps you even felt like you were with a parent rather than a partner. This can be a difficult and frustrating dynamic to navigate, but don't worry – there are ways to move forward and find healthier relationships.\r\n\r\nThe wise and strong Emperor advises you to be your own guardian and take control of your life. This means taking responsibility for your own well-being, setting boundaries, and making decisions that are in your best interest. When you take ownership of your life, you'll attract people who respect your boundaries and support your independence.\r\n\r\nOn the other hand, if you continue to rely on others to make decisions for you, you'll likely attract people who want to take control of your life. This can lead to more dysfunctional relationships and a sense of feeling trapped or powerless.\r\n\r\nSo how can you improve your self-reliance? Start by identifying areas where you may be overly dependent on others. This could include financial support, emotional validation, or decision-making. Once you've identified these areas, take small steps towards becoming more self-sufficient. This could mean creating a budget and managing your own finances, seeking out therapy or support groups to work through emotional issues, or practicing making decisions on your own, even if they are small.\r\n\r\nRemember, improving your self-reliance takes time and practice, but it's a crucial step towards building healthy, fulfilling relationships. The Emperor reminds you that you have the power within you to create the life you want – all you need to do is take the first step."
        }
    }
}

Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-5.divineapi.com/api/v2/heartbreak-reading' \
--header 'Authorization: Bearer {Your Auth Token}' \
--form 'api_key="Your API key"' \
--form 'card_image="1"' \
--form 'lan="en"'

NodeJS

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://astroapi-5.divineapi.com/api/v2/heartbreak-reading',
  'headers': {
    'Authorization': 'Bearer {Your Auth Token}'
  },
  formData: {
    'api_key': 'Your API key',
    'card_image': '1',
    'lan': 'en'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

JavaScript jQuery AJAX

var form = new FormData();
form.append("api_key", "Your API key");
form.append("card_image", "1");
form.append("lan", "en");

var settings = {
  "url": "https://astroapi-5.divineapi.com/api/v2/heartbreak-reading",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {Your Auth Token}"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Python

import requests

url = "https://astroapi-5.divineapi.com/api/v2/heartbreak-reading"

payload = {'api_key': 'Your API key',
'card_image': '1',
'lan': 'en'}

headers = {
  'Authorization': 'Bearer {Your Auth Token}'
}

response = requests.request("POST", url, headers=headers, data=payload,)

print(response.text)
curl -X POST "https://astroapi-5.divineapi.com/api/v2/heartbreak-reading" \
  -H "Authorization: Bearer {Your Auth Token}" \
  --form 'api_key="{Your API Key}"' \
  --form 'card_image="1"' \
  --form 'lan="en"'
const FormData = require('form-data');
const axios = require('axios');

const form = new FormData();
form.append('api_key', '{Your API Key}');
form.append('card_image', '1');
form.append('lan', 'en');

const response = await axios.post('https://astroapi-5.divineapi.com/api/v2/heartbreak-reading', form, {
  headers: {
    ...form.getHeaders(),
    'Authorization': 'Bearer {Your Auth Token}',
  }
});

console.log(response.data);
import requests

url = "https://astroapi-5.divineapi.com/api/v2/heartbreak-reading"
headers = {
    "Authorization": "Bearer {Your Auth Token}",
}
payload = {
    "api_key": "{Your API Key}",
    "card_image": "1",
    "lan": "en",
}

response = requests.post(url, headers=headers, data=payload)

print(response.json())
const formData = new FormData();
formData.append('api_key', '{Your API Key}');
formData.append('card_image', '1');
formData.append('lan', 'en');

const response = await fetch('https://astroapi-5.divineapi.com/api/v2/heartbreak-reading', {
  method: 'POST',
  headers: {
      'Authorization': "Bearer {Your Auth Token}",
    },
  body: formData,
});

const data = await response.json();
console.log(data);
<?php

use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('POST', 'https://astroapi-5.divineapi.com/api/v2/heartbreak-reading', [
    'headers' => [
        'Authorization' => 'Bearer {Your Auth Token}',
    ],
    'multipart' => [
        ['name' => 'api_key', 'contents' => '{Your API Key}'],
        ['name' => 'card_image', 'contents' => '1'],
        ['name' => 'lan', 'contents' => 'en'],
    ],
]);

echo $response->getBody();
package main

import (
    "bytes"
    "fmt"
    "mime/multipart"
    "net/http"
    "io"
)

func main() {
    body := &bytes.Buffer{}
    writer := multipart.NewWriter(body)
    writer.WriteField("api_key", "{Your API Key}")
    writer.WriteField("card_image", "1")
    writer.WriteField("lan", "en")
    writer.Close()

    req, _ := http.NewRequest("POST", "https://astroapi-5.divineapi.com/api/v2/heartbreak-reading", body)
    req.Header.Set("Content-Type", writer.FormDataContentType())
    req.Header.Set("Authorization", "Bearer {Your Auth Token}")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body2, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body2))
}
import okhttp3.*;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();

        RequestBody body = new MultipartBody.Builder()
            .setType(MultipartBody.FORM)
            .addFormDataPart("api_key", "{Your API Key}")
            .addFormDataPart("card_image", "1")
            .addFormDataPart("lan", "en")
            .build();

        Request request = new Request.Builder()
            .url("https://astroapi-5.divineapi.com/api/v2/heartbreak-reading")
            .post(body)
            .addHeader("Authorization", "Bearer {Your Auth Token}")
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}
import Foundation

let url = URL(string: "https://astroapi-5.divineapi.com/api/v2/heartbreak-reading")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer {Your Auth Token}", forHTTPHeaderField: "Authorization")

let boundary = "Boundary-\(UUID().uuidString)"
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

var bodyData = Data()
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"api_key\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("{Your API Key}\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"card_image\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("1\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"lan\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("en\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)--\r\n".data(using: .utf8)!)
request.httpBody = bodyData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}
task.resume()
import okhttp3.*

fun main() {
    val client = OkHttpClient()

    val body = MultipartBody.Builder()
        .setType(MultipartBody.FORM)
        .addFormDataPart("api_key", "{Your API Key}")
        .addFormDataPart("card_image", "1")
        .addFormDataPart("lan", "en")
        .build()

    val request = Request.Builder()
        .url("https://astroapi-5.divineapi.com/api/v2/heartbreak-reading")
        .post(body!!)
        .addHeader("Authorization", "Bearer {Your Auth Token}")
        .build()

    client.newCall(request).execute().use { response ->
        println(response.body?.string())
    }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
    static async Task Main() {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer {Your Auth Token}");

        var content = new MultipartFormDataContent();
        content.Add(new StringContent("{Your API Key}"), "api_key");
        content.Add(new StringContent("1"), "card_image");
        content.Add(new StringContent("en"), "lan");

        var response = await client.PostAsync("https://astroapi-5.divineapi.com/api/v2/heartbreak-reading", content);
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}
Response 200
{
    "success": 1,
    "data": {
        "prediction": {
            "card1": "THE HANGED MAN",
            "card2": "JUSTICE",
            "card1_image": "https://divineapi.com/admin/uploads/tarot-breakup/13.png",
            "card2_image": "https://divineapi.com/admin/uploads/tarot-breakup/12.png",
            "cause": "It's possible that your connection with your partner had the power to turn your lives completely upside down. Perhaps one of you had an expectation that the other would give up their own personal needs in order to make the relationship work. Or maybe one of you was willing to compromise your own values and beliefs in order to avoid rejection or conflict. Whatever the case may be, it's clear that this was a relationship that was codependent at its core.\r\n\r\nRecognizing this fact is a significant step towards personal growth and healing. It takes a lot of courage to acknowledge that a relationship has been unhealthy or even abusive, and it's important to give yourself credit for having the strength to walk away.\r\n\r\nAs you move forward, it's important to focus on bringing closure to this chapter of your life. This can involve seeking out support from friends, family, or a therapist, and taking the time to process your feelings and emotions in a healthy way. Remember that healing is a process, and it's okay to take things one day at a time.\r\n\r\nUltimately, by choosing to walk away from a relationship that was putting your life on the line, you're taking a powerful step towards reclaiming your own agency and living life on your own terms. It may not be easy, but it's important to remember that you are worth the effort and the investment. Keep moving forward, and know that there are brighter days ahead.",
            "advise": "If you're reading this, you may have recently experienced the end of a relationship that ended in a tie. Perhaps you feel like justice wasn't served, or that the outcome was unfair. It's natural to feel frustrated and disappointed in situations like these, especially when we feel like we've been treated unjustly.\r\n\r\nHowever, it's important to keep your emotions in check and to try to move forward from the situation. While it may be tempting to dwell on the past and the things that went wrong in the relationship, doing so will only hold you back and prevent you from finding happiness in the future.\r\n\r\nInstead, try to be honest with yourself about your goals for relationships. What are the things that are most important to you in a partner? What are the things that you're willing to compromise on, and what are the things that are non-negotiable? By being clear about your priorities, you'll be better equipped to attract someone who is a good fit for you.\r\n\r\nRemember, a balanced person is more likely to attract someone who is also balanced. If you're too rigid in your expectations or too focused on the past, it can be difficult for someone to connect with you on a deeper level. By staying open-minded and focusing on the future, you'll increase your chances of finding someone who is truly right for you.\r\n\r\nSo don't let the end of this relationship hold you back. Use it as an opportunity to learn and grow, and to become a better, more balanced person. With time and effort, you'll find someone who is a good match for you and who shares your goals and values."
        }
    }
}