Reference

DEX Screener API reference

Review Suggestions API
The AI Suggestions API, powered by the Secure Opinion AI Model, generates intelligent recommendations based on user input, context, and historical data. This enhances search functionality, content discovery, and decision-making processes by providing personalized and context-aware suggestions.
POST/review_service/review/reviews_suggestion/
Code Snippet:

Request Body

  • review: This is useless.

Response Structure

  • previous_prompt: string
  • is_abusive: boolean
  • refined_prompts: nullable array of string

Request

const response = await fetch("/review_service/review/reviews_suggestion/", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "review": "This is useless."
  }
});
const data = await response.json();
console.log(data);

Response

{
  "previous_prompt": "This is useless.",
  "is_abusive": true,
  "refined_prompts": [
    "I didn't find this helpful.",
    "This didn't meet my expectations.",
    "I'm not satisfied with this.",
    "This didn't work for me.",
    "I found this ineffective."
  ]
}

Parameters

NameTypeRequiredDescription
reviewstrThe review text that needs improvement.

Response Fields

FieldTypeDescription
previous_promptstringThe previous prompt that was classified as abusive.
is_abusivebooleanWhether the text is abusive or not.
refined_promptsnullable array of stringThe refined prompts if the text is classified as abusive.

Success Response

HTTP StatusStatus MessageDescription
201OKThe request was successful.

Error Responses

HTTP StatusError MessageDescription
400Invalid inputIf the input text is missing or improperly formatted.

Implementation Notes

The Secure Opinion AI Model powers the generation of review suggestions, ensuring context-aware and accurate recommendations.

To maintain consistency and prevent randomness, the AI model is configured with low variability, ensuring reliable output for review suggestions.

An advanced abusive language filter is implemented to automatically detect and block inappropriate content, ensuring all generated suggestions adhere to community guidelines.

The final response, generated by the Secure Opinion AI Model, is returned in JSON format, providing users with easy-to-process review suggestions.

Submit a Review for a Business
This API allows users to submit business reviews, which are processed and securely stored on the blockchain using the Secure Opinion AI Model. The AI model helps validate the authenticity of reviews, ensuring transparency and preventing fraudulent submissions. Users may also earn rewards if the business has an active campaign.
POST/review_service/public_api/post-review/
Code Snippet:

Request Body

  • user_id: user_id
  • business_id: business_id
  • name: reviewer_name
  • description: This is review description.
  • rating: 5

Response Structure

  • status: string
  • tx_hash: string

Request

const response = await fetch("/review_service/public_api/post-review/", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "user_id": "user_id",
    "business_id": "business_id",
    "name": "reviewer_name",
    "description": "This is review description.",
    "rating": 5
  }
});
const data = await response.json();
console.log(data);

Response

{
  "status": "review posted",
  "tx_hash": "yyy"
}

Request Fields

NameTypeRequiredDescription
user_idintThe ID of the user submitting the review.
business_idintThe ID of the business being reviewed.
namestrThe reviewer's name.
descriptionstrThe content of the review.
ratingintThe rating given to the business (e.g., 1-5 stars).

Response Fields

FieldTypeDescription
statusstringThe status of the review submission.
tx_hashstringThe transaction hash of the review submission.

Success Response

HTTP StatusStatus MessageDescription
201OKThe request was successful.

Error Responses

HTTP StatusError MessageDescription
400Invalid requestIf the request body is missing or improperly formatted.
401UnauthorizedIf the API key is invalid or missing.
403ForbiddenIf the user is not authorized to access the requested resource.
404Not foundIf the requested resource does not exist.

Implementation Notes

The Secure Opinion AI Model validates reviews for spam, bias, and inappropriate language.

Valid reviews are stored on the blockchain with a unique transaction hash (tx_hash) for transparency.

If the business has an active campaign, the user’s wallet is updated with rewards based on the review rating.

The review submission is processed asynchronously for faster response times.

Error handling is in place for issues like mismatched user IDs or invalid business IDs.

API access is secured, and sensitive data is encrypted for safe transactions.

Get Business Reviews API
Retrieves all verified user reviews stored on the blockchain. The Secure Opinion AI Model ensures that only authentic, non-biased, and spam-free reviews are returned. Supports filtering, pagination, and sorting options. It supports pagination, providing metadata such as the current page, total number of reviews, and total pages.
GET/review_service/public_api/business-reviews/53
Code Snippet:

Request Query Params

  • page: 1
  • per_page: 10

Response Structure

  • reviews: array of review object
  • page: integer
  • per_page: integer
  • total_pages: integer
  • total_count: integer

Request

const response = await fetch("/review_service/public_api/business-reviews/53", {
  "method": "GET",
  "headers": {
    "Content-Type": "application/json"
  },
  "queryParams": {
    "page": 1,
    "per_page": 10
  }
});
const data = await response.json();
console.log(data);

Response

{
  "reviews": [
    {
      "id": 74,
      "description": "2",
      "business_name": "Adnan Ashraf",
      "rating": 4,
      "created_at": "2024-11-17T15:29:59.278177",
      "user_id": 68,
      "business_id": 53,
      "tx_hash": null,
      "tx_receipt": null,
      "coins_earned": 1
    }
  ],
  "page": 1,
  "per_page": 10,
  "total_pages": 1,
  "total_count": 1
}

Parameters

NameTypeRequiredDescription
business_idintThe unique identifier of the business whose reviews are being fetched.
pageint❌ (default: 1)The page number for pagination.
per_pageint❌ (default: 10)The number of reviews to display per page.

Response Fields

FieldTypeDescription
reviewslistA list of review objects.
reviews[].idintThe unique identifier of the review.
reviews[].descriptionstringThe content of the review.
reviews[].business_namestringThe name of the business associated with the review.
reviews[].ratingintThe rating given in the review (e.g., 1-5 stars).
reviews[].created_atstringThe timestamp when the review was created.
reviews[].user_idintThe ID of the user who posted the review.
reviews[].business_idintThe ID of the business associated with the review.
reviews[].tx_hashstringThe transaction hash associated with the review.
reviews[].tx_receiptstringThe transaction receipt associated with the review.
reviews[].coins_earnedfloatThe number of coins earned for posting the review.
pageintThe current page number.
per_pageintThe number of reviews per page.
total_pagesintThe total number of pages available based on per_page.
total_countintThe total number of reviews available for the business.

Success Response

HTTP StatusStatus MessageDescription
200OKThe request was successful.

Error Responses

HTTP StatusError MessageDescription
400Invalid business IDIf the provided business_id is invalid.
404No reviews foundIf no reviews exist for the given business.

Implementation Notes

The API supports pagination by calculating the total review count and determining the total number of pages.

Reviews are sorted in descending order by their creation date.

If the requested page number exceeds the total pages, the last available page is returned.

The response is standardized using ReviewResponse serialization.

Review Suggestions API
Submit a Review for a Business
Get Business Reviews API