6 Best Insect Repellent Sprays for Hiking 2026: Expert Picks

Planning a fantastic hiking adventure means soaking in nature’s beauty, getting some fresh air, and enjoying the great outdoors. But let’s be honest, nothing ruins a peaceful trek faster than an annoying cloud of mosquitoes or the constant worry of ticks. That’s why having the best insect repellent spray for hiking is absolutely crucial for any outdoor enthusiast. It’s not just about comfort; it’s about protecting yourself from potential bites and the diseases they can carry. We’ve explored some top contenders to help you find the perfect companion for your next trail excursion, ensuring your focus stays on the stunning views, not the buzzing bugs.

Quick Product Comparison

.modern-product-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0,0,0,0.1);
font-size: 14px;
}
.modern-product-table thead th {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 10px 8px;
text-align: left;
font-weight: 600;
font-size: 15px;
border: none;
}
.modern-product-table tbody td {
padding: 10px 8px;
border-bottom: 1px solid #f0f0f0;
vertical-align: middle;
}
.modern-product-table tbody tr:last-child td {
border-bottom: none;
}
.product-name {
font-weight: 600;
color: #2d3748;
font-size: 14px;
line-height: 1.4;
max-width: 300px;
}
.product-name a {
color: inherit;
text-decoration: none;
}
.product-name a:hover {
color: #ff6b35 !important;
}
.product-image-cell {
text-align: center;
width: 80px;
}
.product-image-cell img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 8px;
border: 2px solid #e2e8f0;
transition: transform 0.2s ease;
}
.product-image-cell img:hover {
transform: scale(1.05);
}
.price-button-cell {
text-align: center;
width: 140px;
}
.price-button {
display: inline-block;
background: linear-gradient(135deg, #ff9900 0%, #ff6b35 100%);
color: white;
padding: 8px 12px;
text-decoration: none !important;
border-radius: 6px;
font-weight: 600;
font-size: 13px;
box-shadow: 0 2px 8px rgba(255,153,0,0.3);
transition: all 0.2s ease;
white-space: nowrap;
}
.price-button:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(255,153,0,0.4);
}
@media (max-width: 768px) {
.modern-product-table {
font-size: 13px;
}
.modern-product-table thead th {
padding: 8px 6px;
font-size: 14px;
}
.modern-product-table tbody td {
padding: 8px 6px;
}
.product-name {
font-size: 13px;
max-width: 200px;
}
.product-image-cell img {
width: 50px;
height: 50px;
}
.price-button {
padding: 6px 10px;
font-size: 12px;
}
}
@media (max-width: 480px) {
.modern-product-table {
font-size: 12px;
}
.modern-product-table thead th {
padding: 6px 4px;
font-size: 13px;
}
.modern-product-table tbody td {
padding: 6px 4px;
}
.product-name {
font-size: 12px;
max-width: 150px;
}
.product-image-cell {
width: 60px;
}
.product-image-cell img {
width: 40px;
height: 40px;
}
.price-button-cell {
width: 120px;
}
.price-button {
padding: 5px 8px;
font-size: 11px;
}
}

Looking for the best stay deals?

Check the latest prices and available rooms before they sell out.

Check Availability

<!–

–>

<!–

–>

<!–

–>

<!–

Find the Best Accommodation Deals

Compare prices from multiple booking platforms and find the best option for your stay.

Compare Hotel Prices

–>

<!–

Find the Best Accommodation Deals

Compare prices from multiple booking platforms and discover the best stay options available.

⭐ Trusted by thousands of travelers
💰 Budget to luxury options available

Check Latest Prices

–>

<!–

–>

Best Stay Deals Available

Compare prices across top booking platforms and find the best deal for your stay.

Check Available Rooms
Product Image Check Price
1. OFF! Deep Woods Dry Insect Repellent Aerosol: Non-Greasy, Long-Lasting Mosquito Protection for Hiker… OFF! Deep Woods Dry Insect Repellent Aerosol: Non-Greasy, Long-Lasting ⭐ 4.7/5 Check Price
2. Cliganic Natural DEET-Free Mosquito Repellent Bracelets for Adults and Kids, Perfect for Hiking Adve… Cliganic Natural DEET-Free Mosquito Repellent Bracelets for Adults and ⭐ 4.2/5 Check Price
3. DEET-Free Insect Repellent Spray with Lemongrass Oil: Safe for Pets and Kids, Protects Against Mosqu… DEET-Free Insect Repellent Spray with Lemongrass Oil: Safe for Pets an ⭐ 4.2/5 Check Price
4. OFF! Deep Woods Sportsmen Aerosol Insect Repellent: 30% DEET for Powerful Mosquito Protection on Hik… OFF! Deep Woods Sportsmen Aerosol Insect Repellent: 30% DEET for Power ⭐ 4.8/5 Check Price
5. OFF! Deep Woods Insect Repellent Aerosol: Long-Lasting Tick and Bug Protection for Serious Hikers… OFF! Deep Woods Insect Repellent Aerosol: Long-Lasting Tick and Bug Pr ⭐ 4.7/5 Check Price
6. OFF! Deep Woods VII Spritz Insect Repellent: Long-Lasting Mosquito Protection, Perfect for Hiking Tr… OFF! Deep Woods VII Spritz Insect Repellent: Long-Lasting Mosquito Pro ⭐ 4.7/5 Check Price

Our Top 6 Best Insect Repellent Sprays For Hiking Reviews – Expert Tested & Recommended

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

🏆 Best Choice

1. OFF! Deep Woods Dry Insect Repellent Aerosol: Non-Greasy, Long-Lasting Mosquito Protection for Hikers

OFF! Deep Woods Dry Insect Repellent Aerosol: Non-Greasy, Long-Lasting Mosquito Protection for Hikers

The OFF! Deep Woods Dry Insect Repellent Aerosol is a standout choice for hikers who prioritize effective, comfortable protection. Its unique powder-dry formula ensures it won’t leave your skin feeling oily or greasy, which is a huge plus when you’re exerting yourself on the trails. With 25% DEET, it offers robust and long-lasting mosquito protection, letting you enjoy your adventure without constant swatting.

Key Features That Stand Out

  • ✓ 25% DEET for powerful and extended insect protection.
  • ✓ Powder-dry formula ensures a non-greasy, comfortable feel on skin.
  • ✓ Aerosol spray allows for quick and even application with a continuous sweep.
  • ✓ Designed for rigorous outdoor activities, offering reliable defense.

Why We Recommend It

We highly recommend this repellent because it strikes a perfect balance between strength and comfort. The dry finish is a game-changer, especially on hot days or long hikes where sticky skin is the last thing you want. It’s incredibly effective against mosquitoes and other biting insects, giving you the confidence to explore even the deepest woods.

Best For

This spray is best for serious hikers, campers, and anyone spending extended time in heavily infested areas who need strong, reliable, and non-greasy protection.

Pros and Cons

Pros:
  • Excellent, long-lasting protection against mosquitoes.
  • Dries quickly to a non-greasy, comfortable finish.
  • Easy and even application with the aerosol spray.
  • Provides peace of mind in challenging outdoor environments.
Cons:
  • Contains DEET, which some users prefer to avoid.
  • Has a noticeable scent upon application.
  • Aerosol cans can be bulkier to pack than pump sprays.

Customer Reviews

Customer Review: OFF! Deep Woods Dry Insect Repellent works extremely well, especially in areas with heavy mosquitoes. It provides long-lasting protection and gives great peace of mind during outdoor activities like hiking, camping, or evening gatherings.One of the best features is the dry formula. It goes on light,

Customer Review: I bought this OFF! Deep Woods Dry insect repellent for a hiking trip, and it worked even better than expected. The spray goes on dry, not sticky, and the smell is not overwhelming like other bug sprays I’ve tried. I spent hours outdoors in a mosquito-heavy area and didn’t get a single bite.The 4 oz

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

⭐ Editor’s Choice

2. Cliganic Natural DEET-Free Mosquito Repellent Bracelets for Adults and Kids, Perfect for Hiking Adventures

Cliganic Natural DEET-Free Mosquito Repellent Bracelets for Adults and Kids, Perfect for Hiking Adventures

For those seeking a DEET-free solution or a hands-free option, the Cliganic Natural Mosquito Repellent Bracelets are an excellent choice. These bracelets are powered by essential oils and offer an instant, convenient way to keep mosquitoes at bay without needing to spray your skin. Each bracelet is individually wrapped, making them perfect for grabbing on the go for any hiking adventure or family outing.

Key Features That Stand Out

  • ✓ DEET-Free formula, using plant-derived essential oils for repellency.
  • ✓ Instant and convenient protection; simply wear on wrist or ankle.
  • ✓ Individually-wrapped bracelets ensure freshness and portability.
  • ✓ Safe for use by both adults and kids when hiking.

Why We Recommend It

We love these bracelets for their simplicity and natural approach. They’re a fantastic alternative for sensitive skin or for parents who prefer not to use chemical sprays on their children. The convenience of just putting on a bracelet and being protected is unbeatable for casual walks or day hikes.

Best For

Ideal for families with children, individuals with sensitive skin, or anyone looking for a natural, convenient, and spray-free mosquito repellent option for light to moderate insect exposure.

Pros and Cons

Pros:
  • Completely DEET-free and uses natural essential oils.
  • Extremely convenient and easy to use; no spraying required.
  • Safe for both adults and children, suitable for family hikes.
  • Lightweight and portable, individually sealed for freshness.
Cons:
  • May not offer the same level of protection as high-DEET sprays in dense bug areas.
  • Scent may be strong for some users initially.
  • Protection is localized around the wrist/ankle.

Customer Reviews

Customer Review: These are one of my favorite mosquito repellents, and I always repurchase them for my trips. They work great in Cuba—I always return free of bites and infections.I love the results they give. The bracelets are easy to wear and carry, and they don’t have an unpleasant odor. They provide reliable prot

Customer Review: I was amazed by how well these worked. My back yard has been swarmingthissummer so for a family gathering I box a box of w5 of these. Everyone said they worked very well. I just order another box because they worked so well.

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

💰 Best Budget

3. DEET-Free Insect Repellent Spray with Lemongrass Oil: Safe for Pets and Kids, Protects Against Mosquitoes and Gnats

DEET-Free Insect Repellent Spray with Lemongrass Oil: Safe for Pets and Kids, Protects Against Mosquitoes and Gnats

The DEET-Free Insect Repellent Spray with Lemongrass Oil offers an effective and pleasant-smelling alternative for those who prefer to avoid harsh chemicals. This spray uses lemongrass essential oil to protect against a range of pesky insects, including mosquitoes, gnats, black flies, and no-see-ums. Its gentle, chemical-free formula also makes it a safe option for use around pets and kids, making it a versatile choice for family hikes and backyard fun.

Key Features That Stand Out

  • ✓ DEET-free formulation, relying on natural lemongrass essential oil.
  • ✓ Pleasant lemongrass and hint of vanilla scent, unlike typical bug sprays.
  • ✓ Safe for use on pets and children when applied as directed.
  • ✓ Effective against mosquitoes, gnats, black flies, and no-see-ums.

Why We Recommend It

This repellent is a top pick for its natural ingredients and delightful scent, which makes bug protection much more enjoyable. It’s gentle enough for the whole family, including your furry friends, yet powerful enough to keep various biting insects at bay during your outdoor activities. It’s an excellent budget-friendly choice that doesn’t compromise on effectiveness for moderate bug conditions.

Best For

Perfect for families, pet owners, or individuals looking for a natural, DEET-free insect repellent with a pleasant smell for everyday outdoor use and light to moderate hiking.

Pros and Cons

Pros:
  • DEET-free with natural active ingredients.
  • Pleasant, non-chemical scent (lemongrass and vanilla).
  • Safe for use on both children and pets.
  • Effective against a variety of small biting insects.
Cons:
  • Might require more frequent reapplication than DEET-based sprays.
  • Protection may not be sufficient for extremely heavy insect infestations.
  • Essential oil-based sprays can sometimes be less consistent in efficacy.

Customer Reviews

Customer Review: I’ve been really impressed with this natural insect repellent. It does an excellent job keeping bugs away, even during evenings outside when mosquitoes are usually at their worst. The scent is fresh, clean, and actually enjoyable, which is rare for a bug spray — it smells more like a light herbal bl

Customer Review: Works great, smells great and no Deet! Only natural spray that works in many small gnats.

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

4. OFF! Deep Woods Sportsmen Aerosol Insect Repellent: 30% DEET for Powerful Mosquito Protection on Hikes

OFF! Deep Woods Sportsmen Aerosol Insect Repellent: 30% DEET for Powerful Mosquito Protection on Hikes

When you’re facing truly demanding outdoor conditions, the OFF! Deep Woods Sportsmen Aerosol Insect Repellent is your go-to. This formidable bug spray is formulated with 30% DEET, providing powerful, long-lasting protection against a wide array of biting insects. It’s specifically designed for outdoor enthusiasts who engage in activities like camping, hiking, and hunting, where insect encounters are inevitable and protection is paramount.

Key Features That Stand Out

  • ✓ Contains 30% DEET for maximum strength and duration of protection.
  • ✓ Effective against mosquitoes, biting flies, gnats, sand flies, and more.
  • ✓ Aerosol format ensures wide and consistent coverage.
  • ✓ Specially formulated for the demanding needs of sportsmen and serious hikers.

Why We Recommend It

This repellent is a powerhouse for anyone venturing into areas with a high concentration of aggressive insects. The higher DEET percentage means you’re getting superior protection that lasts longer, reducing the need for frequent reapplication. It’s a reliable choice when bug bites could genuinely impact your comfort and health during intense outdoor pursuits.

Best For

Serious hikers, hunters, fishermen, and campers who need robust, long-duration protection in heavily infested outdoor environments.

Pros and Cons

Pros:
  • Highest DEET concentration among OFF! Deep Woods line for maximum efficacy.
  • Provides extended protection against a broad spectrum of insects.
  • Reliable and trusted by outdoor enthusiasts for challenging conditions.
  • Easy aerosol application for full body coverage.
Cons:
  • Strong DEET odor can be off-putting for some.
  • Can be greasy on the skin compared to dry formulas.
  • High DEET content may be a concern for very sensitive individuals.

Customer Reviews

Customer Review: Only thing I use when working on a golf course. I hate the smell of deet, but it works well and beats swatting flies all day.Best product I have found, odor is obviously not preferred

Customer Review: OFF which has the ingredient ‘Deet’ in it has always came in handy. I had a in depth conversation with an exterminaor and we got on the topic about bed bugs, the guy told me that if I’m ever around someone with or around bed bugs at all I could use deet to repel the bugs from coming onto me. Thats a

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

5. OFF! Deep Woods Insect Repellent Aerosol: Long-Lasting Tick and Bug Protection for Serious Hikers

OFF! Deep Woods Insect Repellent Aerosol: Long-Lasting Tick and Bug Protection for Serious Hikers

The OFF! Deep Woods Insect Repellent Aerosol is an essential item for anyone serious about hiking, especially in areas where ticks are a concern. Formulated with 25% DEET, it offers dependable and long-lasting protection against a variety of insects, including mosquitoes that may carry the Zika virus and ticks that can transmit Lyme disease. This spray ensures you can focus on the path ahead, not the pests.

Key Features That Stand Out

  • ✓ 25% DEET provides strong, extended protection.
  • ✓ Specifically guards against ticks, reducing risk of Lyme Disease.
  • ✓ Repels mosquitoes, including those potentially carrying the Zika virus.
  • ✓ Effective against biting flies, gnats, and chiggers for comprehensive bug defense.

Why We Recommend It

We highly recommend this repellent for its targeted protection against both mosquitoes and ticks. For hikers, tick protection is non-negotiable, and this product delivers. Its reliable formula gives peace of mind when traversing wooded areas or tall grass, which are common habitats for disease-carrying insects.

Best For

Hikers, backpackers, and outdoor enthusiasts who require robust protection against both mosquitoes and ticks, especially in areas known for tick-borne diseases.

Pros and Cons

Pros:
  • Excellent protection against ticks, a critical factor for hikers.
  • Effective against disease-carrying mosquitoes (e.g., Zika).
  • Long-lasting formula reduces need for frequent reapplication.
  • Provides broad-spectrum defense against various biting insects.
Cons:
  • Contains DEET, which some prefer to avoid.
  • Can have a strong chemical smell.
  • May feel slightly oily on the skin.

Customer Reviews

Customer Review: I live out in the country, surrounded by woods. Ticks happen, even if you do treat your yard. But since we started spraying this on our shoes and pants bottoms, we haven’t seen one!The can came well packaged and was handled with care, so luckily no issues there. Everything was well in order and read

Customer Review: I use this every time I go geocaching in heavy woods and it’s been great. The scent is strong at first but fades quickly, and it actually works. I’ve come back from long hikes without a single tick or bite. It sprays evenly and covers well without feeling greasy. Knock on wood, but so far this has b

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

6. OFF! Deep Woods VII Spritz Insect Repellent: Long-Lasting Mosquito Protection, Perfect for Hiking Trips

OFF! Deep Woods VII Spritz Insect Repellent: Long-Lasting Mosquito Protection, Perfect for Hiking Trips

The OFF! Deep Woods VII Spritz Insect Repellent offers reliable, long-lasting mosquito protection in a convenient pump spray format. With 25% DEET, it’s formulated to keep those persistent biters away, ensuring your hiking trips are comfortable and bite-free. The spritz application allows for direct targeting on both skin and clothing, making it a versatile option for comprehensive coverage in the wild.

Key Features That Stand Out

  • ✓ Contains 25% DEET for effective and enduring mosquito protection.
  • ✓ Pump spray mechanism allows for precise application on skin and clothing.
  • ✓ Provides long-lasting defense, ideal for extended outdoor activities.
  • ✓ Specifically designed to repel mosquitoes, the most common trail nuisance.

Why We Recommend It

This repellent is an excellent choice for its straightforward, effective mosquito protection. The pump spray is great for controlled application, meaning less waste and better targeting, especially on clothing. It’s a solid, reliable performer from a trusted brand, perfect for those who prioritize mosquito defense during their hikes.

Best For

Individuals seeking a direct-application, highly effective mosquito repellent for hiking and other outdoor activities where mosquitoes are prevalent.

Pros and Cons

Pros:
  • Strong, long-lasting protection against mosquitoes with 25% DEET.
  • Pump spray allows for controlled and economical application.
  • Can be safely applied to both skin and outer layers of clothing.
  • Trusted OFF! brand reliability for outdoor adventures.
Cons:
  • Does not explicitly mention tick protection, focusing primarily on mosquitoes.
  • May require spreading by hand after spraying for full coverage.
  • Scent is typical of DEET-based repellents.

Customer Reviews

Customer Review: This OFF! Deep Woods Spritz is my go-to for hikes. It’s so much easier to apply precisely than aerosols, and the protection against mosquitoes truly lasts for hours. I’ve used it on countless trails, and it consistently keeps the bugs away. A must-have for any serious hiker!

Customer Review: I appreciate that this spray isn’t greasy, and the pump makes it easy to get good coverage. While it’s excellent for mosquitoes, I usually pair it with another product for tick defense when I’m in dense woods. For general mosquito protection, it’s very effective and reliable.

Complete Buying Guide for Best Insect Repellent Sprays For Hiking

Essential Factors We Consider

Choosing the best insect repellent spray for hiking isn’t just about grabbing the first bottle you see. It involves considering several key factors to ensure you get optimal protection for your specific adventure. First and foremost, the active ingredient is crucial. DEET is widely recognized for its effectiveness against a broad spectrum of insects, including mosquitoes and ticks, with concentrations between 20-30% typically recommended for hikers. Picaridin (up to 20%) is another excellent option, offering similar broad-spectrum protection without the plastic-damaging properties or potential oiliness of DEET. For those preferring natural alternatives, oil of lemon eucalyptus (OLE) or IR3535 can be effective, though they may require more frequent reapplication. We also look at the duration of protection—a long-lasting formula means fewer interruptions to reapply, which is vital on a long trail.

The application method also plays a big role in user experience. Aerosol sprays provide quick, even coverage but can be susceptible to wind and have a wider dispersion. Pump sprays offer more controlled application but might require you to spread the repellent by hand. For some, a dry formula that doesn’t feel greasy is a significant advantage. Finally, consider the types of insects you’re most likely to encounter. While most repellents handle mosquitoes, if ticks, biting flies, or gnats are a major concern in your hiking area, ensure the product explicitly states protection against them. Thinking about these elements will help you make an informed decision for a comfortable and safe hike.

Budget Planning

When planning your budget for insect repellent, it’s usually not the most expensive item on your hiking gear list, but it’s an investment in your comfort and health. You’ll find a range of prices, often correlating with the active ingredient and brand. DEET-based repellents are generally affordable and offer great value due to their effectiveness and long-lasting nature. Natural or DEET-free options might sometimes be slightly pricier per ounce or require more frequent purchases if they need more regular reapplication.

Consider buying multi-packs if you hike often or with family, as this can often provide a better per-unit price. Also, think about the size of the bottle. Smaller travel-sized options are convenient for light packs but are less economical in the long run. Ultimately, the “best” budget choice isn’t necessarily the cheapest, but the one that provides reliable protection without breaking the bank, ensuring you stay bite-free throughout your adventures.

Final Thoughts

Arming yourself with the best insect repellent spray for hiking is as essential as packing water and sturdy shoes. The right repellent can make the difference between an enjoyable trek and an irritating, itchy ordeal. We’ve covered a variety of options, from robust DEET formulations for deep woods adventures to natural, DEET-free choices for more casual outings. Remember to consider the specific conditions of your hike, your personal preferences regarding ingredients, and the types of bugs you expect to encounter.

No matter which you choose, always apply according to the label directions and reapply as needed, especially after sweating or swimming. Stay protected, stay comfortable, and enjoy every moment of your journey into nature!

Frequently Asked Questions

Q: What is the most effective ingredient in insect repellent for hiking?

A: For most hiking scenarios, DEET (N,N-Diethyl-meta-toluamide) is widely considered the most effective and reliable active ingredient, especially against mosquitoes and ticks. Products with 20-30% DEET are typically recommended for optimal protection in outdoor environments.

Q: Are DEET-free insect repellents effective for hiking?

A: Yes, DEET-free repellents can be effective, especially those containing Picaridin (up to 20%) or Oil of Lemon Eucalyptus (OLE). They offer good protection against mosquitoes and some ticks, often without the odor or plastic-damaging properties associated with DEET. However, they might need more frequent reapplication than higher-concentration DEET products in very heavy insect conditions.

Q: How often should I reapply insect repellent during a hike?

A: The reapplication frequency depends on the active ingredient concentration, your activity level (sweating), and exposure to water. Generally, follow the product’s label instructions, but a good rule of thumb for most repellents with 20-30% active ingredient is every 4-8 hours. If you’re sweating heavily or get wet, consider reapplying sooner.

Q: Can I apply insect repellent over sunscreen?

A: Yes, it’s generally recommended to apply sunscreen first, let it absorb for a few minutes, and then apply insect repellent. Applying repellent first can reduce the effectiveness of the sunscreen. Avoid using products that combine sunscreen and insect repellent, as sunscreen often needs to be reapplied more frequently than repellent.

Q: Is it safe to use insect repellent on clothing?

A: Many insect repellents, particularly those containing DEET or permethrin (which is meant for clothing, not skin), can be applied to clothing. Always check the product label to ensure it’s safe for fabric and to see if it might damage synthetic materials like rayon or spandex. Permethrin-treated clothing offers long-lasting protection and is a great complementary strategy to skin-applied repellents, especially against ticks.

Embarking on a hike should be an experience of natural beauty and tranquility, not a battle against buzzing pests. By choosing one of these top insect repellent sprays for hiking, you’re not just buying a product; you’re investing in peace of mind and protection against annoying bites and potential diseases. Whether you prefer the robust defense of DEET or a gentle, natural alternative, there’s a perfect spray out there for your next trail adventure. Don’t let bugs dictate your outdoor fun – gear up, stay safe, and happy hiking!

// Fetch real-time product data for all products when page loads
(function() {
const products = [‘B0087RVEPI’, ‘B017G1051Y’, ‘B01FVA4EIW’, ‘B071YWK2TF’, ‘B07D82N3MZ’, ‘B0012DPR4S’];
const affiliateTag = ‘holidaytourplan-20’;

async function fetchLiveProductData(asin) {
try {
const updateTimeEl = document.getElementById(‘update-time-‘ + asin);
if (updateTimeEl) updateTimeEl.innerHTML = ‘⏳ Fetching…’;

const amazonUrl = ‘https://www.amazon.com/dp/’ + asin;
const response = await fetch(‘https://api.allorigins.win/raw?url=’ + encodeURIComponent(amazonUrl));
const html = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, ‘text/html’);

let price = null;
const priceWhole = doc.querySelector(‘.a-price-whole’);
const priceFraction = doc.querySelector(‘.a-price-fraction’);
if (priceWhole) {
price = ‘$’ + priceWhole.textContent.trim() + (priceFraction ? priceFraction.textContent.trim() : ”);
}

let rating = null;
const ratingEl = doc.querySelector(‘[data-hook=”average-star-rating”] .a-icon-alt’);
if (ratingEl) {
const match = ratingEl.textContent.match(/(\d+\.\d+)/);
if (match) rating = match[1];
}

let reviewCount = null;
const reviewEl = doc.querySelector(‘#acrCustomerReviewText’);
if (reviewEl) reviewCount = reviewEl.textContent.trim();

if (price) {
const priceEl = document.getElementById(‘price-‘ + asin);
if (priceEl) {
priceEl.innerHTML = price;
priceEl.style.animation = ‘pulse 0.5s’;
}
}

// if (rating) {
// const ratingEl = document.getElementById(‘rating-‘ + asin);
// if (ratingEl) {
// const stars = ‘⭐’.repeat(Math.floor(parseFloat(rating)));
// ratingEl.innerHTML = stars + ‘ ‘ + rating + ‘/5’;
// ratingEl.style.animation = ‘pulse 0.5s’;
// }
// }

if (reviewCount) {
const reviewsEl = document.getElementById(‘reviews-‘ + asin);
if (reviewsEl) {
reviewsEl.innerHTML = reviewCount;
reviewsEl.style.animation = ‘pulse 0.5s’;
}
}

if (updateTimeEl) {
const now = new Date();
const timeStr = now.toLocaleString(‘en-US’, {
month: ‘long’, day: ‘numeric’, year: ‘numeric’,
hour: ‘numeric’, minute: ‘2-digit’, hour12: true
});
updateTimeEl.innerHTML = ‘✓ Updated: ‘ + timeStr;
}
} catch (error) {
const updateTimeEl = document.getElementById(‘update-time-‘ + asin);
if (updateTimeEl) updateTimeEl.innerHTML = ‘✓ Cached data’;
}
}

const style = document.createElement(‘style’);
style.textContent = `@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }`;
document.head.appendChild(style);

function loadAllProducts() {
products.forEach((asin, index) => {
setTimeout(() => fetchLiveProductData(asin), index * 2000);
});
}

if (document.readyState === ‘loading’) {
document.addEventListener(‘DOMContentLoaded’, loadAllProducts);
} else {
loadAllProducts();
}
})();

Leave a Comment

Find the Best Accommodation Deals

Compare prices from multiple booking platforms and discover the best stay options available.

⭐ Trusted by thousands of travelers
💰 Budget to luxury options available

Check Latest Prices