Skip to main content

Get Your API Key

Sign up at useadmesh.com to get your free API key.

Make Your First API Call

Basic cURL Example

curl -X POST "https://api.useadmesh.com/agent/recommend" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best CRM for startups",
    "format": "auto"
  }'
Response:
{
  "session_id": "sess_1760022990_w8RkKA",
  "intent": {
    "goal": "The user wants to find and evaluate leading ad networks for potential use.",
    "purchase_intent": "research",
    "intent_type": "product_discovery",
    "categories": ["ad_networks", "digital_marketing", "advertising_platforms"],
    "intent_group": "commercial",
    "layout_type": "citation"
  },
  "response": {
    "summary": "Here are ad_networks tools that match your goal: The user wants to find and evaluate leading ad networks for potential use.",
    "citation_summary": "If you're looking for a top-notch ad network, consider [AdMesh](https://api.useadmesh.com/click/r/b1e5d17f-4f76-4669-800c-163398db0cc5?utm_product=0c9521fb-e60a-443d-84c7-14ce37b1063e&utm_redirect=https%3A%2F%2Fuseadmesh.com%2F&utm_rec=feca26b8-a468-461f-9d14-b8e8951588e1&utm_session=sess_1760022990_w8RkKA&utm_agent=w8RkKArkAad2KEfm3J7kwlvFDzb2&test=true). It's a trusted platform known for excellent earning potential and relevant to your marketing interests.",
    "recommendations": [
      {
        "product_id": "0c9521fb-e60a-443d-84c7-14ce37b1063e",
        "title": "AdMesh",
        "recommendation_description": "Website not provided, assuming as a developer tool for building marketing and design interfaces.",
        "admesh_link": "https://api.useadmesh.com/click/r/b1e5d17f-4f76-4669-800c-163398db0cc5?utm_product=0c9521fb-e60a-443d-84c7-14ce37b1063e&utm_redirect=https%3A%2F%2Fuseadmesh.com%2F&utm_rec=feca26b8-a468-461f-9d14-b8e8951588e1&utm_session=sess_1760022990_w8RkKA&utm_agent=w8RkKArkAad2KEfm3J7kwlvFDzb2&test=true",
        "categories": ["Marketing", "Development Tools", "SaaS"],
        "trust_score": 100.0,
        "reward_note": "$10.00 per signup (Free Promo Credit - 5 max conversions)",
        "meta": {
          "ad_id": "b1e5d17f-4f76-4669-800c-163398db0cc5",
          "offer_trust_score": 100.0,
          "brand_trust_score": 100,
          "contextual_relevance_score": 69.19,
          "reason": "This offer matches your category interest and relevant to your query and trusted platform and excellent earning potential.",
          "description": "Website not provided, assuming as a developer tool for building marketing and design interfaces.",
          "keywords": ["useadmesh", "marketing", "design", "development", "saas", "web", "tool", "interface", "building", "admesh"],
          "url": "https://useadmesh.com/",
          "redirect_url": "https://useadmesh.com/"
        }
      }
    ],
    "followup_suggestions": [
      {
        "label": "What features does AdMesh offer?",
        "query": "AdMesh key features and benefits"
      },
      {
        "label": "AdMesh pricing plans",
        "query": "AdMesh pricing and plans"
      },
      {
        "label": "Best ad_networks tools like AdMesh",
        "query": "Best ad_networks tools similar to AdMesh"
      }
    ],
    "layout_type": "citation"
  },
  "tokens_used": 500,
  "model_used": "openai/gpt-4o"
}

Understanding the Response

The API returns a comprehensive response structure that includes:
  • session_id: Unique identifier for tracking the conversation
  • intent: Detected user intent with goal, purchase intent, categories, and recommended layout
  • response: Main response containing:
    • summary: Text summary of recommendations
    • citation_summary: Markdown-formatted summary with embedded links (when layout_type is “citation”)
    • recommendations: Array of product recommendations with detailed metadata
    • followup_suggestions: Suggested follow-up queries for continued conversation
    • layout_type: Recommended UI layout for displaying results
  • tokens_used: Number of AI tokens consumed
  • model_used: AI model used for processing

Key Fields for Integration

  • Use admesh_link for all clicks to ensure proper tracking and attribution
  • The meta.reason field provides detailed explanation for why each product was recommended
  • trust_score and contextual_relevance_score help you prioritize recommendations
  • contextual_relevance_score (0-100) indicates how well the product matches the user’s intent and is used for CPX billing calculations
  • followup_suggestions enable conversational experiences

Choose Your Language

const getRecommendations = async (query, format = 'auto') => {
  const response = await fetch('https://api.useadmesh.com/agent/recommend', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      query: query,
      format: format
    })
  });

  const data = await response.json();
  return data.response.recommendations;
};

// Usage
const recommendations = await getRecommendations('best CRM for startups');

Next Steps (Optional)

If you’re building a frontend, you can use our React components to display recommendations:
npm install admesh-ui-sdk
import { AdMeshLayout } from 'admesh-ui-sdk';

function MyApp() {
  const [recommendations, setRecommendations] = useState([]);

  const fetchRecommendations = async (query) => {
    // Call your backend API (which calls AdMesh)
    const response = await fetch('/api/recommendations', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ query })
    });
    const recs = await response.json();
    setRecommendations(recs);
  };

  return (
    <AdMeshLayout
      recommendations={recommendations}
      layout="auto"
      onRecommendationClick={(adId, admeshLink) => window.open(admeshLink)}
    />
  );
}
Learn more about UI components →
app.post('/api/recommendations', async (req, res) => {
  const { query, format = 'auto' } = req.body;

  const response = await fetch('https://api.useadmesh.com/agent/recommend', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.ADMESH_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      query: query,
      format: format
    })
  });

  const data = await response.json();
  res.json(data.response.recommendations);
});
See more backend examples →
Each recommendation includes:
  • title - Product/service name
  • reason - Why it’s recommended for this query
  • admesh_link - Tracking URL (use this for clicks)
  • pricing - Cost information
  • features - Key features list
  • trial_days - Free trial period
View complete API reference →

You’re Ready!

That’s it! You now have AdMesh recommendations working in your application.

What’s Next?